class B {
constructor(x) {
this.x = x;
}
static [Symbol.create]() {
var o = super();
weakMap.set(o, 123456789); // Dom wrapper foo
return o;
}
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() { | |
'use strict'; | |
function uncurryThis(f) { | |
return f.call.bind(f); | |
} | |
var ShadowRoot = window.ShadowRoot; | |
var createShadowRoot = uncurryThis(Element.prototype.createShadowRoot); | |
var ownerDocumentGetter = uncurryThis(Object.getOwnPropertyDescriptor(Node.prototype, 'ownerDocument').get); |
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
if (!Document.prototype.createAttributeNS) { | |
Document.prototype.createAttributeNS = function(namespaceURI, qualifiedName) { | |
var dummy = this.createElement('dummy'); | |
dummy.setAttributeNS(namespaceURI, qualifiedName, ''); | |
var attr = dummy.attributes[0]; | |
dummy.removeAttributeNode(attr); | |
return attr; | |
}; | |
} |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../google-map/google-map.html"> | |
<polymer-element name="my-element"> |
WithStatement : with ( Expression ) Statement
- Let val be the result of evaluating Expression.
- Let obj be ToObject(GetValue(val)).
- ReturnIfAbrupt(obj).
- Let oldEnv be the running execution context’s LexicalEnvironment.
- Let newEnv be NewObjectEnvironment(obj, oldEnv).
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
At the July TC39 meeting we decided to explore removing @@create in favor of a model where super()
in a [[Construct]]
call creates the instance object. To correctly know how to create the instance and set the prototype a [[Construct]]
call gets an implicit receiver which is the constructor function new
was called with.
class Base {
constructor() {
var object = Object.create(new*.prototype); // new binding needs new syntax...
// bikeshed...
myWeakMap.set(object, myHiddenData);
return object;
}
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(); | |
} | |
}; |
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
'use strict'; | |
class Base { | |
constructor(x) { | |
this.x = x; | |
} | |
} | |
let f; | |
class D1 extends Base { | |
constructor() { |
OlderNewer