Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Unified Diff: lib/runtime/dart/_runtime.js

Issue 1700153002: Wrapperless dart:html and friends (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: A couple more tweaks Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart/_js_mirrors.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_runtime.js
diff --git a/lib/runtime/dart/_runtime.js b/lib/runtime/dart/_runtime.js
index 80227d1379f000e8cabedada9b45f9908b88b923..b7f72f77f98c0b84486158e05c19f11f6eb434ec 100644
--- a/lib/runtime/dart/_runtime.js
+++ b/lib/runtime/dart/_runtime.js
@@ -130,6 +130,7 @@ dart_library.library('dart/_runtime', null, /* Imports */[
}
function _setStaticTypes(f, names) {
for (let name of names) {
+ if (!f[name]) continue;
tagMemoized(f[name], function() {
let parts = f[_staticSig][name];
return definiteFunctionType.apply(null, parts);
@@ -153,7 +154,7 @@ dart_library.library('dart/_runtime', null, /* Imports */[
function virtualField(subclass, fieldName) {
let prop = getOwnPropertyDescriptor(subclass.prototype, fieldName);
if (prop) return;
- let symbol = Symbol(subclass.name + '.' + fieldName);
+ let symbol = Symbol(subclass.name + '.' + fieldName.toString());
defineProperty(subclass.prototype, fieldName, {
get: function() {
return this[symbol];
@@ -179,7 +180,7 @@ dart_library.library('dart/_runtime', null, /* Imports */[
const dartx = {};
function getExtensionSymbol(name) {
let sym = dartx[name];
- if (!sym) dartx[name] = sym = Symbol('dartx.' + name);
+ if (!sym) dartx[name] = sym = Symbol('dartx.' + name.toString());
return sym;
}
function defineExtensionNames(names) {
@@ -192,9 +193,9 @@ dart_library.library('dart/_runtime', null, /* Imports */[
copyTheseProperties(jsProto, extProto, getOwnPropertySymbols(extProto));
}
function registerExtension(jsType, dartExtType) {
+ if (!jsType) return;
let extProto = dartExtType.prototype;
let jsProto = jsType.prototype;
- assert_(jsProto[_extensionType] === void 0);
jsProto[_extensionType] = dartExtType;
_installProperties(jsProto, extProto);
let originalSigFn = getOwnPropertyDescriptor(dartExtType, _methodSig).get;
@@ -205,6 +206,7 @@ dart_library.library('dart/_runtime', null, /* Imports */[
let proto = type.prototype;
for (let name of methodNames) {
let method = getOwnPropertyDescriptor(proto, name);
+ if (!method) continue;
defineProperty(proto, getExtensionSymbol(name), method);
}
let originalSigFn = getOwnPropertyDescriptor(type, _methodSig).get;
« no previous file with comments | « lib/runtime/dart/_js_mirrors.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698