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

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: Address comments 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
« 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 cd602b4add7d1c6c1e51524d7c531210d0dd2bc6..255d61964ea7f6c2923ccc2f359d1333c4eb336e 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();
} 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.
vsm 2015/05/21 20:08:47 John and I were just discussing this. I *think* t
Leaf 2015/05/21 22:47:34 It either needs to stay as dynamic, or get canonic
vsm 2015/05/22 15:52:04 Ah, I was thinking that the reified type of any ob
while (args.length < length) args.push(dart.dynamic);
let value = resultMap;
« 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