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

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

Issue 23766002: Work around runtime engine deficiencies. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/foreign_helper.dart
===================================================================
--- sdk/lib/_internal/lib/foreign_helper.dart (revision 26873)
+++ sdk/lib/_internal/lib/foreign_helper.dart (working copy)
@@ -255,3 +255,17 @@
* externally initialized elements.
*/
void JS_EFFECT(Function code) { code(null); }
+
+/**
+ * Use this class for creating constants that hold JavaScript code.
+ * For example:
+ *
+ * const constant = JS_CONST('typeof window != "undefined");
+ *
+ * This code will generate:
+ * $.JS_CONST_1 = typeof window != "undefined";
+ */
+class JS_CONST {
+ String code;
+ const JS_CONST(this.code);
+}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | sdk/lib/typed_data/dart2js/typed_data_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698