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

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

Issue 237583014: JS templates (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: cleanup Created 6 years, 8 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: 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 1036bfdb25540a67d5e265feb3ca4b8c3aefdfed..eb70b1b49c50d499bfd66cebe2631eb2fc9ff2dc 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -1133,8 +1133,17 @@ class JsInstanceMirror extends JsObjectMirror implements InstanceMirror {
var interceptor = getInterceptor(object);
if (!useEval) return _newInterceptGetterNoEvalFn(name, interceptor);
String className = JS('String', '#.constructor.name', interceptor);
+ /*
var body = "(function $className\$$name(o){return i.$name(o)})";
floitsch 2014/04/22 16:11:18 dead code.
sra1 2014/04/23 02:33:50 Done.
return JS('', '(function(b,i){return eval(b)})(#,#)', body, interceptor);
+ */
+ String functionName = '$className\$$name';
+ var body =
+ '(function(i) {'
+ ' function $functionName(o){return i.$name(o)}'
+ ' return $functionName;'
+ '})';
+ return JS('', '(function(b){return eval(b)})(#)(#)', body, interceptor);
}
_newInterceptGetterNoEvalFn(n, i) => JS('',
« sdk/lib/_internal/lib/isolate_helper.dart ('K') | « sdk/lib/_internal/lib/js_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698