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

Unified Diff: lib/runtime/dart/js.js

Issue 1448993002: Switch ddc to use @JS instead of @JSName (Closed) Base URL: git://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 1 month 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/_js_helper.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/js.js
diff --git a/lib/runtime/dart/js.js b/lib/runtime/dart/js.js
index ba88479d5886cdb2972ebb0faf9386a0defe12aa..51bbe0a40a90879b0f24ab2e090fdeb3f16b5708 100644
--- a/lib/runtime/dart/js.js
+++ b/lib/runtime/dart/js.js
@@ -390,6 +390,31 @@ dart_library.library('dart/js', null, /* Imports */[
return value;
}
dart.fn(_putIfAbsent, core.Object, [dart.dynamic, dart.dynamic, dart.functionType(dart.dynamic, [dart.dynamic])]);
+ function allowInterop(f) {
+ return f;
+ }
+ dart.fn(allowInterop, core.Function, [core.Function]);
+ dart.defineLazyProperties(exports, {
+ get _interopCaptureThisExpando() {
+ return new (core.Expando$(core.Function))();
+ },
+ set _interopCaptureThisExpando(_) {}
+ });
+ function allowInteropCaptureThis(f) {
+ let ret = exports._interopCaptureThisExpando.get(f);
+ if (ret == null) {
+ ret = dart.as(function() {
+ let args = [this];
+ for (let arg of arguments) {
+ args.push(arg);
+ }
+ return f(...args);
+ }, core.Function);
+ exports._interopCaptureThisExpando.set(f, ret);
+ }
+ return ret;
+ }
+ dart.fn(allowInteropCaptureThis, core.Function, [core.Function]);
let __CastType0$ = dart.generic(function(E) {
let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.dynamic, [E]));
return __CastType0;
@@ -400,4 +425,6 @@ dart_library.library('dart/js', null, /* Imports */[
exports.JsFunction = JsFunction;
exports.JsArray$ = JsArray$;
exports.JsArray = JsArray;
+ exports.allowInterop = allowInterop;
+ exports.allowInteropCaptureThis = allowInteropCaptureThis;
});
« no previous file with comments | « lib/runtime/dart/_js_helper.js ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698