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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library _foreign_helper; 5 library _foreign_helper;
6 6
7 /** 7 /**
8 * Emits a JavaScript code fragment parameterized by arguments. 8 * Emits a JavaScript code fragment parameterized by arguments.
9 * 9 *
10 * Hash characters `#` in the [codeTemplate] are replaced in left-to-right order 10 * Hash characters `#` in the [codeTemplate] are replaced in left-to-right order
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 * var foo; 248 * var foo;
249 * 249 *
250 * main() { 250 * main() {
251 * JS_EFFECT((_){ foo = _; }) 251 * JS_EFFECT((_){ foo = _; })
252 * } 252 * }
253 * 253 *
254 * TODO(sra): Replace this hack with something to mark the volatile or 254 * TODO(sra): Replace this hack with something to mark the volatile or
255 * externally initialized elements. 255 * externally initialized elements.
256 */ 256 */
257 void JS_EFFECT(Function code) { code(null); } 257 void JS_EFFECT(Function code) { code(null); }
258
259 /**
260 * Use this class for creating constants that hold JavaScript code.
261 * For example:
262 *
263 * const constant = JS_CONST('typeof window != "undefined");
264 *
265 * This code will generate:
266 * $.JS_CONST_1 = typeof window != "undefined";
267 */
268 class JS_CONST {
269 String code;
270 const JS_CONST(this.code);
271 }
OLDNEW
« 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