lively.lang
Version:
JavaScript utils providing useful abstractions for working with collections, functions, objects.
14 lines (9 loc) • 368 B
JavaScript
/*global beforeEach, afterEach, describe, it, setInterval, clearInterval, setTimeout*/
import { expect } from "mocha-es6";
import Closure from "lively.lang/closure.js";
describe("closure", function() {
it("captures values", function() {
var f = Closure.fromFunction(function() { return y + 3 }, {y: 2}).recreateFunc();
expect(f()).to.equal(5);
});
});