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

Side by Side Diff: frog/corejs.dart

Issue 8567016: Fix a spurious warning in Frog selfhost (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/frogsh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * Generates JS helpers for dart:core. This used to be in a file "core.js". 6 * Generates JS helpers for dart:core. This used to be in a file "core.js".
7 * Having them in Dart code means we can easily control which are generated. 7 * Having them in Dart code means we can easily control which are generated.
8 */ 8 */
9 // TODO(jmesserly): one idea to make this cleaner: put these as private "native" 9 // TODO(jmesserly): one idea to make this cleaner: put these as private "native"
10 // methods somewhere in a library that we import. This would be rather elegant 10 // methods somewhere in a library that we import. This would be rather elegant
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 return res; 284 return res;
285 }"""); 285 }""");
286 } 286 }
287 287
288 if (useNotNullBool) { 288 if (useNotNullBool) {
289 useThrow = true; 289 useThrow = true;
290 // This pattern chosen because IE9 does really badly with typeof, and 290 // This pattern chosen because IE9 does really badly with typeof, and
291 // it's still decent on other browsers. 291 // it's still decent on other browsers.
292 w.writeln(@""" 292 w.writeln(@"""
293 function $notnull_bool(test) { 293 function $notnull_bool(test) {
294 return (test === true || test === false) ? test : test.is$bool(); 294 return (test === true || test === false) ? test : test.is$bool(); // TypeError
295 }"""); 295 }""");
296 } 296 }
297 297
298 if (useAssert) { 298 if (useAssert) {
299 useThrow = true; 299 useThrow = true;
300 w.writeln(@""" 300 w.writeln(@"""
301 function $assert(test, text, url, line, column) { 301 function $assert(test, text, url, line, column) {
302 if (typeof test == 'function') test = test(); 302 if (typeof test == 'function') test = test();
303 if (!test) $throw(new AssertError(text, url, line, column)); 303 if (!test) $throw(new AssertError(text, url, line, column));
304 }"""); 304 }""");
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 Object.prototype.$setindex = function(i, value) { return this[i] = value; } 384 Object.prototype.$setindex = function(i, value) { return this[i] = value; }
385 Array.prototype.$setindex = function(i, value) { return this[i] = value; }"""); 385 Array.prototype.$setindex = function(i, value) { return this[i] = value; }""");
386 } 386 }
387 387
388 // Write operator helpers 388 // Write operator helpers
389 for (var opImpl in orderValuesByKeys(_usedOperators)) { 389 for (var opImpl in orderValuesByKeys(_usedOperators)) {
390 w.writeln(opImpl); 390 w.writeln(opImpl);
391 } 391 }
392 } 392 }
393 } 393 }
OLDNEW
« no previous file with comments | « no previous file | frog/frogsh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698