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

Unified Diff: lib/runtime/dart_runtime.js

Issue 1148333003: No dynamic at runtime (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_runtime.js
diff --git a/lib/runtime/dart_runtime.js b/lib/runtime/dart_runtime.js
index a05cf97c6ec91917cc29848966028ef72a6183e8..17923378e83de59f59dbabccb8a994bdac6a4827 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -565,8 +565,13 @@ var dart, _js_helper, _js_primitives;
if (arguments.length == 1) {
// No type arguments, it's all dynamic
let len = closure.length;
- let args = Array.apply(null, new Array(len)).map(() => dart.dynamic);
- t = functionType(dart.dynamic, args);
+ function build() {
+ let args = Array.apply(null, new Array(len)).map(() => core.Object);
+ return functionType(core.Object, args);
+ }
+ // We could be called before Object is defined.
+ if (core.Object === void 0) return fn(closure, build);
+ t = build();
vsm 2015/05/20 23:03:10 yikes ... perhaps we should move Object to this fi
Leaf 2015/05/20 23:35:28 Yes, figuring out some way to architect things so
} else {
// We're passed the piecewise components of the function type,
// construct it.
@@ -958,6 +963,10 @@ var dart, _js_helper, _js_primitives;
throw Error('requires ' + length + ' or 0 type arguments');
}
let args = Array.prototype.slice.call(arguments);
+ // TODO(leafp): This should really be core.Object for
+ // consistency, but Object is not attached to core
+ // until the entire core library has been processed,
+ // which is too late.
while (args.length < length) args.push(dart.dynamic);
let value = resultMap;

Powered by Google App Engine
This is Rietveld 408576698