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

Unified Diff: lib/runtime/dart_runtime.js

Issue 1117793002: add checks needed for covariant generics, and List<E> (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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/math.js ('k') | lib/src/codegen/js_codegen.dart » ('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 c9c21ea81135409a3a068380013d6b5474ec4d79..c529805a3c9158760ff7dc71465b0ed690eeffb3 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -631,6 +631,7 @@ var dart, _js_helper, _js_primitives;
function copyProperties(to, from) {
return copyPropertiesHelper(to, from, getOwnNamesAndSymbols(from));
}
+ dart.copyProperties = copyProperties;
/**
* Copy symbols from the prototype of the source to destination.
@@ -641,10 +642,14 @@ var dart, _js_helper, _js_primitives;
return copyPropertiesHelper(to.prototype, from.prototype,
getOwnPropertySymbols(from.prototype));
}
-
- dart.copyProperties = copyProperties;
dart.registerExtension = registerExtension;
+ function setBaseClass(derived, base) {
+ // Link the extension to the type it's extending as a base class.
+ derived.prototype.__proto__ = base.prototype;
+ }
+ dart.setBaseClass = setBaseClass;
+
/**
* This is called whenever a derived class needs to introduce a new field,
* shadowing a field or getter/setter pair on its parent.
@@ -869,12 +874,18 @@ var dart, _js_helper, _js_primitives;
}
dart.const = constant;
- /** Sets the runtime type of `obj` to be `type` */
+ /** Sets the type of `obj` to be `type` */
function setType(obj, type) {
- obj[_runtimeType] = type;
+ obj.__proto__ = type.prototype;
}
dart.setType = setType;
+ /** Sets the internal runtime type of `obj` to be `type` */
+ function setRuntimeType(obj, type) {
+ obj[_runtimeType] = type;
+ }
+ dart.setRuntimeType = setRuntimeType;
+
// The following are helpers for Object methods when the receiver
// may be null or primitive. These should only be generated by
// the compiler.
« no previous file with comments | « lib/runtime/dart/math.js ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698