This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://web.archive.org/web/20160310120458/http://wiki.ecmascript.org/doku.php?id=strawman:scoped_object_extensions | |
// in whatever-extras.js | |
import Whatever from './whatever.js'; | |
export extension Extensions = Whatever.protoype { | |
somethingComplex: function() { ... } | |
} | |
// in user code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.defineProperty(Number.prototype,Symbol.iterator,{ | |
*value({ start = 0, step = 1 } = {}) { | |
var inc = this > 0 ? step : -step; | |
for (let i = start; Math.abs(i) <= Math.abs(this); i += inc) { | |
yield i; | |
} | |
}, | |
enumerable: false, | |
writable: true, | |
configurable: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ v8 git:(69191fe7d6) eshost -t _test.js | |
┌────────────────┬───────────┐ | |
│ chakra │ 4 │ | |
├────────────────┼───────────┤ | |
│ javascriptcore │ 4 │ | |
├────────────────┼───────────┤ | |
│ spidermonkey │ 4 │ | |
├────────────────┼───────────┤ | |
│ v8 │ undefined │ | |
├────────────────┼───────────┤ |
OlderNewer