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. |