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

Unified Diff: sdk/lib/_internal/lib/js_mirrors.dart

Issue 208043003: Rename [call$...] properties to [$...] in compiled code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: found another use of call Created 6 years, 9 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 | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/compiler/dart2js/closure_codegen_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index 687699314ea6d66de5ee861b97af6c0a02bd3fb4..313b456e29c3555ae89724fa89bd1180f023917b 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -2045,14 +2045,17 @@ class JsClosureMirror extends JsInstanceMirror implements ClosureMirror {
if (cachedFunction != null) return cachedFunction;
disableTreeShaking();
// TODO(ahe): What about optional parameters (named or not).
+ String callPrefix = "${JS_GET_NAME("CALL_PREFIX")}\$";
var extractCallName = JS('', r'''
function(reflectee) {
for (var property in reflectee) {
- if ("call$" == property.substring(0, 5)) return property;
+ if (# == property.substring(0, #) &&
+ property[#] >= '0' &&
+ property[#] <= '9') return property;
}
return null;
}
-''');
+''', callPrefix, callPrefix.length, callPrefix.length, callPrefix.length);
String callName = JS('String|Null', '#(#)', extractCallName, reflectee);
if (callName == null) {
throw new RuntimeError('Cannot find callName on "$reflectee"');
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/compiler/dart2js/closure_codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698