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

Unified Diff: lib/runtime/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 1999273002: fix performance of setType (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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:
Download patch
« no previous file with comments | « no previous file | lib/src/compiler/code_generator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_sdk.js
diff --git a/lib/runtime/dart_sdk.js b/lib/runtime/dart_sdk.js
index 258e3233fa66a986a333837bc64f17a6d0f4c85c..577bf8e386d4883fb6259acb0ce339de43aadefc 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -272,7 +272,6 @@ dart_library.library('dart_sdk', null, /* Imports */[
};
dart.setType = function(obj, type) {
obj.__proto__ = type.prototype;
- obj.__proto__[dart._extensionType] = type;
return obj;
};
dart.list = function(obj, elementType) {
@@ -281,6 +280,10 @@ dart_library.library('dart_sdk', null, /* Imports */[
dart.setBaseClass = function(derived, base) {
derived.prototype.__proto__ = base.prototype;
};
+ dart.setExtensionBaseClass = function(derived, base) {
+ derived.prototype[dart._extensionType] = derived;
+ dart.setBaseClass(derived, base);
+ };
dart.throwCastError = function(actual, type) {
dart.throw(new _js_helper.CastErrorImplementation(dart.typeName(actual), dart.typeName(type)));
};
@@ -2760,7 +2763,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
return new (_internal.ListMapView$(E))(this);
}
}
- dart.setBaseClass(JSArray, dart.global.Array);
+ dart.setExtensionBaseClass(JSArray, dart.global.Array);
JSArray[dart.implements] = () => [core.List$(E), _interceptors.JSIndexable];
dart.setSignature(JSArray, {
constructors: () => ({
« no previous file with comments | « no previous file | lib/src/compiler/code_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698