mirror of https://github.com/svaarala/duktape.git
Sami Vaarala
10 years ago
4 changed files with 23 additions and 12 deletions
@ -1,8 +1,12 @@ |
|||
if (typeof console === 'undefined') { |
|||
this.console = {}; |
|||
Object.defineProperty(this, 'console', { |
|||
value: {}, writable: true, enumerable: false, configurable: true |
|||
}); |
|||
} |
|||
if (typeof console.log === 'undefined') { |
|||
this.console.log = function () { |
|||
print(Array.prototype.join.call(arguments, ' ')); |
|||
}; |
|||
Object.defineProperty(this.console, 'log', { |
|||
value: function () { |
|||
print(Array.prototype.join.call(arguments, ' ')); |
|||
}, writable: true, enumerable: false, configurable: true |
|||
}); |
|||
} |
|||
|
@ -1,5 +1,7 @@ |
|||
if (typeof Object.prototype.__defineGetter__ === 'undefined') { |
|||
Object.prototype.__defineGetter__ = function (n, f) { |
|||
Object.defineProperty(this, n, { enumerable: true, configurable: true, get: f }); |
|||
}; |
|||
Object.defineProperty(Object.prototype, '__defineGetter__', { |
|||
value: function (n, f) { |
|||
Object.defineProperty(this, n, { enumerable: true, configurable: true, get: f }); |
|||
}, writable: true, enumerable: false, configurable: true |
|||
}); |
|||
} |
|||
|
@ -1,5 +1,7 @@ |
|||
if (typeof Object.prototype.__defineSetter__ === 'undefined') { |
|||
Object.prototype.__defineSetter__ = function (n, f) { |
|||
Object.defineProperty(this, n, { enumerable: true, configurable: true, set: f }); |
|||
}; |
|||
Object.defineProperty(Object.prototype, '__defineSetter__', { |
|||
value: function (n, f) { |
|||
Object.defineProperty(this, n, { enumerable: true, configurable: true, set: f }); |
|||
}, writable: true, enumerable: false, configurable: true |
|||
}); |
|||
} |
|||
|
Loading…
Reference in new issue