Preserve original execution order in :: operator.
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
|
||||
var _context;
|
||||
|
||||
var f = ns.obj.func.bind(ctx);
|
||||
var g = (_context = ns.obj).func.bind(_context);
|
||||
var f = (_context = ctx, ns.obj.func).bind(_context);
|
||||
var g = (_context = ns.obj).func.bind(_context);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
var _context;
|
||||
|
||||
ns.obj.func.call(ctx);
|
||||
(_context = ctx, ns.obj.func).call(_context);
|
||||
(_context = ns.obj).func.call(_context);
|
||||
|
||||
ns.obj1.func.call(ns.obj2);
|
||||
(_context = ns.obj2, ns.obj1.func).call(_context);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
var operations = [];
|
||||
|
||||
var lib = {};
|
||||
|
||||
for (let key of ['f', 'g', 'h']) {
|
||||
let func = () => operations.push(`lib.${key}()`);
|
||||
Object.defineProperty(lib, key, {
|
||||
get() {
|
||||
operations.push(`get lib.${key}`);
|
||||
return func;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
({prop:'value'})
|
||||
::lib.f()
|
||||
::lib.g()
|
||||
::lib.h();
|
||||
|
||||
assert.deepEqual(operations, [
|
||||
'get lib.f',
|
||||
'lib.f()',
|
||||
'get lib.g',
|
||||
'lib.g()',
|
||||
'get lib.h',
|
||||
'lib.h()'
|
||||
]);
|
||||
@@ -1,11 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
var _context;
|
||||
|
||||
var _iterlib = require("iterlib");
|
||||
|
||||
_iterlib.forEach.call(_iterlib.takeWhile.call(_iterlib.map.call(getPlayers(), function (x) {
|
||||
(_context = (_context = (_context = getPlayers(), _iterlib.map).call(_context, function (x) {
|
||||
return x.character();
|
||||
}), function (x) {
|
||||
}), _iterlib.takeWhile).call(_context, function (x) {
|
||||
return x.strength > 100;
|
||||
}), function (x) {
|
||||
}), _iterlib.forEach).call(_context, function (x) {
|
||||
return console.log(x);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user