Add experimental support for ES7 function bind. (issue #1287)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
var f = ctx::ns.obj.func;
|
||||
var g = ::ns.obj.func;
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
var _context;
|
||||
|
||||
var f = ns.obj.func.bind(ctx);
|
||||
var g = (_context = ns.obj).func.bind(_context);
|
||||
@@ -0,0 +1,4 @@
|
||||
ctx::ns.obj.func();
|
||||
::ns.obj.func();
|
||||
|
||||
ns.obj2::ns.obj1.func();
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var _context;
|
||||
|
||||
ns.obj.func.call(ctx);
|
||||
(_context = ns.obj).func.call(_context);
|
||||
|
||||
ns.obj1.func.call(ns.obj2);
|
||||
@@ -0,0 +1,6 @@
|
||||
import { map, takeWhile, forEach } from "iterlib";
|
||||
|
||||
getPlayers()
|
||||
::map(x => x.character())
|
||||
::takeWhile(x => x.strength > 100)
|
||||
::forEach(x => console.log(x));
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
var _iterlib = require("iterlib");
|
||||
|
||||
_iterlib.forEach.call(_iterlib.takeWhile.call(_iterlib.map.call(getPlayers(), function (x) {
|
||||
return x.character();
|
||||
}), function (x) {
|
||||
return x.strength > 100;
|
||||
}), function (x) {
|
||||
return console.log(x);
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"optional": "es7.functionBind"
|
||||
}
|
||||
Reference in New Issue
Block a user