Chromium Code Reviews| Index: tool/input_sdk/private/classes.dart |
| diff --git a/tool/input_sdk/private/classes.dart b/tool/input_sdk/private/classes.dart |
| index d10c6d727e233ae48a72dfff56db8d02f4046665..b06d949c83e32d5293668adaf95e7d82e8350dc9 100644 |
| --- a/tool/input_sdk/private/classes.dart |
| +++ b/tool/input_sdk/private/classes.dart |
| @@ -186,6 +186,8 @@ _setStaticSignature(f, sigF) => |
| // Set the lazily computed runtime type field on static methods |
| _setStaticTypes(f, names) => JS('', '''(() => { |
| for (let name of $names) { |
| + // TODO(vsm): Need to generate static methods. |
| + if (!$f[name]) continue; |
| $tagMemoized($f[name], function() { |
| let parts = $f[$_staticSig][name]; |
| return $definiteFunctionType.apply(null, parts); |
| @@ -236,7 +238,7 @@ virtualField(subclass, fieldName) => JS('', '''(() => { |
| let prop = $getOwnPropertyDescriptor($subclass.prototype, $fieldName); |
| if (prop) return; |
| - let symbol = Symbol($subclass.name + '.' + $fieldName); |
| + let symbol = Symbol($subclass.name + '.' + $fieldName.toString()); |
|
Jennifer Messerly
2016/02/16 17:46:38
nice fix! yeah this bug has existed for a while (p
Jacob
2016/02/16 17:47:35
nit: replace
$subclass.name + '.' + $fieldName.toS
vsm
2016/02/18 01:13:09
The double $ scares me. :-)
|
| $defineProperty($subclass.prototype, $fieldName, { |
| get: function() { return this[symbol]; }, |
| set: function(x) { this[symbol] = x; } |
| @@ -265,7 +267,7 @@ final dartx = JS('', '{}'); |
| getExtensionSymbol(name) => JS('', '''(() => { |
| let sym = $dartx[$name]; |
| - if (!sym) $dartx[$name] = sym = Symbol('dartx.' + $name); |
| + if (!sym) $dartx[$name] = sym = Symbol('dartx.' + $name.toString()); |
| return sym; |
| })()'''); |
| @@ -286,11 +288,13 @@ _installProperties(jsProto, extProto) => JS('', '''(() => { |
| /// JavaScript class. |
| /// |
| registerExtension(jsType, dartExtType) => JS('', '''(() => { |
| + // TODO(vsm): Not all registered js types are real. |
|
Jennifer Messerly
2016/02/16 17:46:38
yeah, it'd be really nice to avoid generating a ca
vsm
2016/02/18 01:13:09
Acknowledged.
|
| + if (!jsType) return; |
| + |
| let extProto = $dartExtType.prototype; |
| let jsProto = $jsType.prototype; |
| // Mark the JS type's instances so we can easily check for extensions. |
| - $assert_(jsProto[$_extensionType] === void 0); |
| jsProto[$_extensionType] = $dartExtType; |
| $_installProperties(jsProto, extProto); |
| let originalSigFn = $getOwnPropertyDescriptor($dartExtType, $_methodSig).get; |
| @@ -321,6 +325,8 @@ defineExtensionMembers(type, methodNames) => JS('', '''(() => { |
| let proto = $type.prototype; |
| for (let name of $methodNames) { |
| let method = $getOwnPropertyDescriptor(proto, name); |
| + // TODO(vsm): Why? |
|
Jennifer Messerly
2016/02/16 17:46:38
yeah, this definitely needs further investigation.
vsm
2016/02/18 01:13:09
Yes, a native type. The type is dart:html Wrapped
|
| + if (!method) continue; |
| $defineProperty(proto, $getExtensionSymbol(name), method); |
| } |
| // Ensure the signature is available too. |