mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-15 05:05:46 +01:00
Add preliminary mode inheritance and BASE/INSERT modes.
This commit is contained in:
@@ -417,12 +417,19 @@ var isinstance_types = {
|
||||
number: Number
|
||||
};
|
||||
function isinstance(targ, src) {
|
||||
if (targ == null)
|
||||
return false;
|
||||
|
||||
src = Array.concat(src);
|
||||
for (var i = 0; i < src.length; i++) {
|
||||
if (typeof src[i] === "string") {
|
||||
if (objproto.toString.call(targ) === "[object " + src[i] + "]")
|
||||
return true;
|
||||
}
|
||||
else if ("isinstance" in targ) {
|
||||
if (targ.isinstance(src[i]))
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
if (targ instanceof src[i])
|
||||
return true;
|
||||
@@ -1317,8 +1324,7 @@ var array = Class("array", Array, {
|
||||
* @returns {Iterator(Object)}
|
||||
*/
|
||||
iterValues: function iterValues(ary) {
|
||||
let length = ary.length;
|
||||
for (let i = 0; i < length; i++)
|
||||
for (let i = 0; i < ary.length; i++)
|
||||
yield ary[i];
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user