mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* remove unused traceur checks * ignore test suites for different major versions * reduce test loading IO * reduce readFile IO * reduce source map loading IO * improve * fix tests * add check --------- Co-authored-by: liuxingbaoyu <[email protected]>
30 lines
460 B
JavaScript
30 lines
460 B
JavaScript
var operations = [];
|
|
|
|
var lib = {};
|
|
|
|
['f', 'g', 'h'].forEach(function (key) {
|
|
var func = function () {
|
|
return operations.push("lib." + key + "()");
|
|
};
|
|
Object.defineProperty(lib, key, {
|
|
get: function () {
|
|
operations.push("get lib." + key);
|
|
return func;
|
|
}
|
|
});
|
|
});
|
|
|
|
({prop:'value'})
|
|
::lib.f()
|
|
::lib.g()
|
|
::lib.h();
|
|
|
|
expect(operations).toEqual([
|
|
'get lib.f',
|
|
'lib.f()',
|
|
'get lib.g',
|
|
'lib.g()',
|
|
'get lib.h',
|
|
'lib.h()'
|
|
]);
|