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

Unified Diff: lib/runtime/dart_runtime.js

Issue 1145283002: Use short array syntax in method signatures (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 | « no previous file | 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 a05cf97c6ec91917cc29848966028ef72a6183e8..cd602b4add7d1c6c1e51524d7c531210d0dd2bc6 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -571,7 +571,7 @@ var dart, _js_helper, _js_primitives;
// We're passed the piecewise components of the function type,
// construct it.
let args = Array.prototype.slice.call(arguments, 1);
- t = functionType.apply(functionType, args);
+ t = functionType.apply(null, args);
}
setRuntimeType(closure, t);
return closure;
@@ -1002,7 +1002,9 @@ var dart, _js_helper, _js_primitives;
if (obj == null) return void 0;
let sigObj = obj.__proto__.constructor[_methodSig];
if (sigObj === void 0) return void 0;
- let sig = sigObj[name];
+ let parts = sigObj[name];
+ if (parts === void 0) return void 0;
+ let sig = functionType.apply(null, parts);
return sig;
}
@@ -1036,7 +1038,10 @@ var dart, _js_helper, _js_primitives;
// Set the lazily computed runtime type field on static methods
function _setStaticTypes(f, names) {
for (let name of names) {
- function getT() { return f[_staticSig][name];};
+ function getT() {
+ let parts = f[_staticSig][name];
+ return functionType.apply(null, parts);
+ };
defineProperty(f[name], _runtimeType, {get : getT});
}
}
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698