Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define(function (require) {
- var LazyExpr = function(options) {
- this.expr = options.expr;
- this.context = options.context;
- };
- var Lazy = function(expr, context) {
- return new LazyExpr({
- expr: expr,
- context: context
- });
- };
- Object.defineProperty(LazyExpr.prototype, "value", {
- configurable: true,
- get: function () {
- var self = this;
- return function() { return eval(self.expr);}.call(this.context);
- }
- });
- return Lazy;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement