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

Unified Diff: lib/runtime/dart_sdk.js

Issue 2069903002: Partial fix for call methods #542 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix to not use dcall Created 4 years, 6 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 89aa138130ea3f845aca09352acc821947d33dfd..1e2d45a6872eeb3936267e7786530acaced04cdb 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -837,8 +837,8 @@ dart_library.library('dart_sdk', null, /* Imports */[
dart.defineNamedConstructor = function(clazz, name) {
let proto = clazz.prototype;
let initMethod = proto[name];
- let ctor = function() {
- return initMethod.apply(this, arguments);
+ let ctor = function(...args) {
+ initMethod.apply(this, args);
};
ctor.prototype = proto;
dart.defineProperty(clazz, name, {value: ctor, configurable: true});
@@ -934,6 +934,16 @@ dart_library.library('dart_sdk', null, /* Imports */[
derived.prototype[dart._extensionType] = derived;
derived.prototype.__proto__ = base.prototype;
};
+ dart.callableClass = function(callableCtor, classExpr) {
+ callableCtor.prototype = classExpr.prototype;
+ callableCtor.prototype.constructor = callableCtor;
+ callableCtor.__proto__ = classExpr.__proto__;
+ return callableCtor;
+ };
+ dart.defineNamedConstructorCallable = function(clazz, name, ctor) {
+ ctor.prototype = clazz.prototype;
+ dart.defineProperty(clazz, name, {value: ctor, configurable: true});
+ };
dart.throwCastError = function(object, actual, type) {
dart.throw(new _js_helper.CastErrorImplementation(object, dart.typeName(actual), dart.typeName(type)));
};
« 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