This file contains 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
<script src="../third_party/harmony-reflect/reflect.js"></script> | |
<script name="testObjectCreate"> | |
(function() { | |
var aPrototype = {foo: 'foo'}; | |
function createProxy(obj) { | |
return Proxy(obj, { | |
get: function(target, name, receiver) { | |
console.log(' (Proxy handler \'get\' called for name = ' + name + ')'); | |
if (name === '__proto__') |
This file contains 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
<script src="../third_party/harmony-reflect/reflect.js"></script> | |
<script name="testObjectCreate"> | |
(function() { | |
var aPrototype = {foo: 'foo'}; | |
var handler = { | |
get: function(target, name, receiver) { | |
console.log(' (Proxy handler \'get\' called for name = ' + name + ')'); | |
return target[name]; | |
} |
This file contains 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
<script src="../third_party/harmony-reflect/reflect.js"></script> | |
<script name="testObjectCreate"> | |
(function() { | |
var aPrototype = {foo: 'foo'}; | |
var handler = { | |
get: function(target, name, receiver) { | |
console.log(' (Proxy handler \'get\' called for name = ' + name + ')'); | |
return target[name]; | |
} |
This file contains 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
ESC[32minfoESC[39m: Welcome to ESC[90mNodejitsuESC[39m ESC[35mjohnjbartonESC[39m | |
ESC[32minfoESC[39m: jitsu v0.13.9, node v0.10.4 | |
ESC[32minfoESC[39m: It worked if it ends with ESC[90mNodejitsuESC[39mESC[1mESC[32m okESC[39mESC[22m | |
ESC[32minfoESC[39m: Executing command ESC[35mdeployESC[39m | |
ESC[32minfoESC[39m: Analyzing application dependencies in ESC[35mbuild/printSemver.jsESC[39m | |
ESC[34mdebugESC[39m: { method: ESC[32m'GET'ESC[39m, | |
ESC[34mdebugESC[39m: uri: ESC[32m'https://api.nodejitsu.com/apps/johnjbarton/traceur'ESC[39m, | |
ESC[34mdebugESC[39m: headers: | |
ESC[34mdebugESC[39m: { Authorization: ESC[32m'*********************************************************************'ESC[39m, | |
ESC[34mdebugESC[39m: ESC[32m'Content-Type'ESC[39m: ESC[32m'application/json'ESC[39m }, |
This file contains 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
{ | |
"name": "traceur", | |
"version": "0.0.10-1", | |
"description": "Experimental ES6 to ES5 compiler", | |
"keywords": [ | |
"javascript", | |
"ecmascript", | |
"language", | |
"es5", | |
"es6", |
This file contains 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
// Comparing some of the use-cases for 'quasi-literals' aka string templates to normal functions and strings | |
// http://wiki.ecmascript.org/doku.php?id=harmony:quasis#syntax | |
x`foo${bar}baz` | |
// vs | |
x('foo',bar,'baz'); | |
// http://wiki.ecmascript.org/doku.php?id=harmony:quasis#secure_content_generation | |
safehtml`<a href="${url}?q=${query}" onclick=alert(${message}) style="color: ${color}">${message}</a>` |
This file contains 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(Object, 'mergeDescriptors', { | |
value: function() { | |
// Shallow copy of the argument property descriptors, right most wins | |
// | |
var properties = {} | |
Array.prototype.slice.call(arguments).forEach(function(source) { | |
Object.getOwnPropertyNames(source).forEach(function(name) { | |
properties[name] = Object.getOwnPropertyDescriptor(source, name) | |
}) | |
}) |
This file contains 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
// Here is a proposal for minimalist JavaScript classes(?), that does not | |
// introduces any additional syntax to the language, instead it standardizes | |
// approach already used by majority of JS frameworks today. | |
// !!! What is a PROBLEM!!! | |
function Dog(name) { | |
// Classes are for creating instances, calling them without `new` changes | |
// behavior, which in majority cases you need to handle, so you end up with | |
// additional boilerplate. |