зеркало из https://github.com/mozilla/gecko-dev.git
Small narcissus formatting fixes. (rs=brendan)
This commit is contained in:
Родитель
006eef985c
Коммит
4ba4d1458c
|
@ -307,7 +307,7 @@ Narcissus.interpreter = (function() {
|
|||
: new TypeError(message);
|
||||
}
|
||||
|
||||
function valuatePhis(n, v) {
|
||||
function evaluatePhis(n, v) {
|
||||
var ps = n.phiUses;
|
||||
if (!ps)
|
||||
return;
|
||||
|
@ -319,7 +319,7 @@ Narcissus.interpreter = (function() {
|
|||
if (ps[i].v === v)
|
||||
break;
|
||||
ps[i].v = v;
|
||||
valuatePhis(ps[i], v);
|
||||
evaluatePhis(ps[i], v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -869,7 +869,7 @@ Narcissus.interpreter = (function() {
|
|||
if (n.backwards) {
|
||||
n.v = v;
|
||||
}
|
||||
valuatePhis(n, v);
|
||||
evaluatePhis(n, v);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
|
|
@ -86,10 +86,8 @@ Narcissus.parser = (function() {
|
|||
if (typeof unbound !== "object")
|
||||
continue;
|
||||
|
||||
/*
|
||||
* We store the bound sub-builder as builder's own property
|
||||
* so that we can have multiple builders at the same time.
|
||||
*/
|
||||
// We store the bound sub-builder as builder's own property
|
||||
// so that we can have multiple builders at the same time.
|
||||
var bound = builder[ns] = {};
|
||||
for (var m in unbound) {
|
||||
bound[m] = bindMethod(unbound[m], builder);
|
||||
|
|
|
@ -1068,21 +1068,18 @@
|
|||
for (var ns in super.prototype) {
|
||||
var childNS = childProto[ns];
|
||||
var superNS = superProto[ns];
|
||||
var childNSType = typeof childNS;
|
||||
if (childNSType === "undefined") {
|
||||
if (childNS === undefined) {
|
||||
childProto[ns] = superNS;
|
||||
} else if (childNSType === "object") {
|
||||
} else {
|
||||
for (var m in superNS) {
|
||||
let childMethod = childNS[m];
|
||||
let superMethod = superNS[m];
|
||||
if (typeof childMethod === "undefined") {
|
||||
if (childMethod === undefined) {
|
||||
childNS[m] = superMethod;
|
||||
} else {
|
||||
childNS[m] = function() {
|
||||
if (this.binds)
|
||||
return childMethod.apply(this, arguments);
|
||||
else
|
||||
return superMethod.apply(this, arguments);
|
||||
return (this.binds ? childMethod : superMethod)
|
||||
.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче