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
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
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
// 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 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
(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
'use strict'; | |
class Base { | |
constructor(x) { | |
this.x = x; | |
} | |
} | |
let f; | |
class D1 extends Base { | |
constructor() { |
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
createPropertyAccessor: function(name, ignoreWrites) { | |
var proto = this.prototype; | |
var privateName = name + '_'; | |
var privateObservable = name + 'Observable_'; | |
Object.defineProperty(proto, name, { | |
get: function() { | |
var observable = this[privateObservable]; | |
if (observable) | |
observable.deliver(); |
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 assert = { | |
equal: function(x, y) { | |
if (x === y) return; | |
throw new Error(); | |
}, | |
isTrue: function(x) { | |
if (x) return; | |
throw new Error(); | |
} | |
}; |