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
(function() { | |
function isNode(value) { | |
return value instanceof Node; | |
} | |
function isAttrObject(value) { | |
return value != null && typeof value === 'object' && !isNode(value); | |
} |
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
var C = 1; | |
function f(x = C) { | |
var C = 2; | |
return x; | |
} | |
var result = f(); // ??? |
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
<!DOCTYPE html> | |
<script src="url.js"></script> | |
<script> | |
var url = new URL('http://www.example.com/a/b/c.html?p=q&r=s&p&p=t#hash'); | |
for (var key in url) { | |
console.log(key, url[key]); | |
} |
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
// And in browsers that support __proto__: | |
document.register('x-foo', { | |
extends: 'p', | |
prototype: { | |
__proto__: HTMLParagraphElement.prototype, | |
get foo() { return 'foo'; } | |
} | |
}) |
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
var data = 42; | |
var object = { | |
get x() { | |
return data; | |
}, | |
set x(v) { | |
notifier.notify({ | |
type: 'updated', | |
name: 'x', | |
oldValue: data |
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
import { | |
variablesInFunction, | |
variablesInBlock, | |
thinger, | |
otherthinger, | |
... | |
} from '../semantics/VariableBinder.js'; |
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
ExportSpecifierSet ::= "{" ExportSpecifier ("," ExportSpecifier)* "}" ("from" Path)? | |
| Id ("from" Path)? | |
| "*" ("from" Path)? |
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.prototype.$super = function() { | |
var func = arguments.callee.caller; | |
var name = func.foundName_; | |
if (!name) { | |
for (var p in this) { | |
if (this[p] == func) { | |
name = p; | |
break; | |
} | |
} |
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
// Create is defined in the latest ES6 spec. Foo[create]() is used to create the instance | |
// when you do "new Foo". This instance is then passed to Foo.call(instance, <args>) | |
import {create} from '@reflect'; | |
Element[create] = function() { | |
return documemt.createElementNS(this.prototype.namespaceURI, this.prototype.localName) | |
}; |
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
traceur --out out.js parser.js | |
# Traceur does not strip dead code. Use Uglify2. | |
uglifyjs src/runtime/runtime.js out.js -cm -o out.min.js |
OlderNewer