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

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

Issue 1144303003: Use signature inheritance when method types are unchanged (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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
Index: lib/runtime/dart/_js_helper.js
diff --git a/lib/runtime/dart/_js_helper.js b/lib/runtime/dart/_js_helper.js
index cb5a6c080cb2bd65388f54bd2f5b9c7fbce84f2c..5225bca097fbc1e6802cce77182df6437a68fc17 100644
--- a/lib/runtime/dart/_js_helper.js
+++ b/lib/runtime/dart/_js_helper.js
@@ -79,7 +79,6 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
dart.defineNamedConstructor(ConstantMap, '_');
dart.setSignature(ConstantMap, {
methods: () => ({
- toString: dart.functionType(core.String, []),
[_throwUnmodifiable]: dart.functionType(dart.dynamic, []),
set: dart.functionType(dart.void, [K, V]),
putIfAbsent: dart.functionType(V, [K, dart.functionType(V, [])]),
@@ -168,12 +167,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
dart.defineNamedConstructor(ConstantProtoMap, '_');
- dart.setSignature(ConstantProtoMap, {
- methods: () => ({
- containsKey: dart.functionType(core.bool, [core.Object]),
- [_fetch]: dart.functionType(dart.dynamic, [dart.dynamic])
- })
- });
+ dart.setSignature(ConstantProtoMap, {});
return ConstantProtoMap;
});
let ConstantProtoMap = ConstantProtoMap$();
@@ -637,7 +631,6 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
JSSyntaxRegExp[dart.implements] = () => [core.RegExp];
dart.setSignature(JSSyntaxRegExp, {
methods: () => ({
- toString: dart.functionType(core.String, []),
firstMatch: dart.functionType(core.Match, [core.String]),
hasMatch: dart.functionType(core.bool, [core.String]),
stringMatch: dart.functionType(core.String, [core.String]),
@@ -983,12 +976,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
TypeImpl[dart.implements] = () => [core.Type];
- dart.setSignature(TypeImpl, {
- methods: () => ({
- toString: dart.functionType(core.String, []),
- '==': dart.functionType(core.bool, [dart.dynamic])
- })
- });
+ dart.setSignature(TypeImpl, {});
class TypeVariable extends core.Object {
TypeVariable(owner, name, bound) {
this.owner = owner;
@@ -1707,9 +1695,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
return this.jsFunction.apply(receiver, arguments$);
}
}
- dart.setSignature(CachedCatchAllInvocation, {
- methods: () => ({invokeOn: dart.functionType(dart.dynamic, [core.Object, core.List])})
- });
+ dart.setSignature(CachedCatchAllInvocation, {});
class CachedNoSuchMethodInvocation extends core.Object {
CachedNoSuchMethodInvocation(interceptor) {
this.interceptor = interceptor;
@@ -2615,9 +2601,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
NullError[dart.implements] = () => [core.NoSuchMethodError];
- dart.setSignature(NullError, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(NullError, {});
class JsNoSuchMethodError extends core.Error {
JsNoSuchMethodError(message, match) {
this[_message] = message;
@@ -2635,9 +2619,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError];
- dart.setSignature(JsNoSuchMethodError, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(JsNoSuchMethodError, {});
class UnknownJsTypeError extends core.Error {
UnknownJsTypeError(message) {
this[_message] = message;
@@ -2647,9 +2629,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`;
}
}
- dart.setSignature(UnknownJsTypeError, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(UnknownJsTypeError, {});
function unwrapException(ex) {
let saveStackTrace = error => {
if (dart.is(error, core.Error)) {
@@ -2747,9 +2727,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
_StackTrace[dart.implements] = () => [core.StackTrace];
- dart.setSignature(_StackTrace, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(_StackTrace, {});
function objectHashCode(object) {
if (dart.notNull(object == null) || typeof object != 'object') {
return dart.hashCode(object);
@@ -3058,7 +3036,6 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
Closure[dart.implements] = () => [core.Function];
dart.setSignature(Closure, {
- methods: () => ({toString: dart.functionType(core.String, [])}),
statics: () => ({
fromTearOff: dart.functionType(dart.dynamic, [dart.dynamic, core.List, core.List, core.bool, dart.dynamic, core.String]),
cspForwardCall: dart.functionType(dart.dynamic, [core.int, core.bool, core.String, dart.dynamic]),
@@ -3149,7 +3126,6 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
dart.setSignature(BoundClosure, {
- methods: () => ({'==': dart.functionType(core.bool, [dart.dynamic])}),
statics: () => ({
selfOf: dart.functionType(dart.dynamic, [BoundClosure]),
targetOf: dart.functionType(dart.dynamic, [BoundClosure]),
@@ -3478,9 +3454,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
TypeErrorImplementation[dart.implements] = () => [core.TypeError];
dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage');
- dart.setSignature(TypeErrorImplementation, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(TypeErrorImplementation, {});
class CastErrorImplementation extends core.Error {
CastErrorImplementation(actualType, expectedType) {
this.message = `CastError: Casting value of type ${actualType} to` + ` incompatible type ${expectedType}`;
@@ -3491,9 +3465,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
CastErrorImplementation[dart.implements] = () => [core.CastError];
- dart.setSignature(CastErrorImplementation, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(CastErrorImplementation, {});
class FallThroughErrorImplementation extends core.FallThroughError {
FallThroughErrorImplementation() {
super.FallThroughError();
@@ -3502,9 +3474,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
return "Switch case fall-through.";
}
}
- dart.setSignature(FallThroughErrorImplementation, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(FallThroughErrorImplementation, {});
function assertHelper(condition) {
if (!(typeof condition == 'boolean')) {
if (dart.is(condition, core.Function))
@@ -3535,9 +3505,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
return `RuntimeError: ${this.message}`;
}
}
- dart.setSignature(RuntimeError, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(RuntimeError, {});
class DeferredNotLoadedError extends core.Error {
DeferredNotLoadedError(libraryName) {
this.libraryName = libraryName;
@@ -3548,9 +3516,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError];
- dart.setSignature(DeferredNotLoadedError, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(DeferredNotLoadedError, {});
class RuntimeType extends core.Object {
RuntimeType() {
}
@@ -3704,8 +3670,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
[_assertCheck]: dart.functionType(dart.dynamic, [dart.dynamic]),
[_check]: dart.functionType(dart.dynamic, [dart.dynamic, core.bool]),
[_extractFunctionTypeObjectFrom]: dart.functionType(dart.dynamic, [dart.dynamic]),
- toRti: dart.functionType(dart.dynamic, []),
- toString: dart.functionType(core.String, [])
+ toRti: dart.functionType(dart.dynamic, [])
}),
statics: () => ({listToRti: dart.functionType(dart.dynamic, [dart.dynamic])}),
names: ['listToRti']
@@ -3739,10 +3704,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
dart.setSignature(DynamicRuntimeType, {
- methods: () => ({
- toString: dart.functionType(core.String, []),
- toRti: dart.functionType(dart.dynamic, [])
- })
+ methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
});
function getDynamicRuntimeType() {
return dart.const(new DynamicRuntimeType());
@@ -3760,10 +3722,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
dart.setSignature(VoidRuntimeType, {
- methods: () => ({
- toString: dart.functionType(core.String, []),
- toRti: dart.functionType(dart.dynamic, [])
- })
+ methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
});
function getVoidRuntimeType() {
return dart.const(new VoidRuntimeType());
@@ -3824,10 +3783,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
dart.setSignature(RuntimeTypePlain, {
- methods: () => ({
- toRti: dart.functionType(dart.dynamic, []),
- toString: dart.functionType(core.String, [])
- })
+ methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
});
class RuntimeTypeGeneric extends RuntimeType {
RuntimeTypeGeneric(name, arguments$, rti) {
@@ -3854,10 +3810,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
dart.setSignature(RuntimeTypeGeneric, {
- methods: () => ({
- toRti: dart.functionType(dart.dynamic, []),
- toString: dart.functionType(core.String, [])
- })
+ methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
});
let _typeData = Symbol('_typeData');
let _cachedToString = Symbol('_cachedToString');
@@ -3962,8 +3915,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
dart.setSignature(FunctionTypeInfoDecoderRing, {
methods: () => ({
toRuntimeType: dart.functionType(RuntimeType, []),
- [_convert]: dart.functionType(core.String, [dart.dynamic]),
- toString: dart.functionType(core.String, [])
+ [_convert]: dart.functionType(core.String, [dart.dynamic])
})
});
class UnimplementedNoSuchMethodError extends core.Error {
@@ -3976,9 +3928,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
UnimplementedNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError];
- dart.setSignature(UnimplementedNoSuchMethodError, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(UnimplementedNoSuchMethodError, {});
function random64() {
let int32a = Math.random() * 0x100000000 >>> 0;
let int32b = Math.random() * 0x100000000 >>> 0;
@@ -4114,9 +4064,7 @@ var _isolate_helper = dart.lazyImport(_isolate_helper);
}
}
MainError[dart.implements] = () => [core.NoSuchMethodError];
- dart.setSignature(MainError, {
- methods: () => ({toString: dart.functionType(core.String, [])})
- });
+ dart.setSignature(MainError, {});
function missingMain() {
throw new MainError("No top-level function named 'main'.");
}

Powered by Google App Engine
This is Rietveld 408576698