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

Side by Side Diff: tool/input_sdk/private/js_helper.dart

Issue 1143953004: Fixes for sunflower (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 _js_helper; 5 library _js_helper;
6 6
7 import 'dart:_js_embedded_names' show 7 import 'dart:_js_embedded_names' show
8 ALL_CLASSES, 8 ALL_CLASSES,
9 GET_ISOLATE_TAG, 9 GET_ISOLATE_TAG,
10 INTERCEPTED_NAMES, 10 INTERCEPTED_NAMES,
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 575
576 static int objectHashCode(object) { 576 static int objectHashCode(object) {
577 int hash = JS('int|Null', r'#.$identityHash', object); 577 int hash = JS('int|Null', r'#.$identityHash', object);
578 if (hash == null) { 578 if (hash == null) {
579 hash = JS('int', '(Math.random() * 0x3fffffff) | 0'); 579 hash = JS('int', '(Math.random() * 0x3fffffff) | 0');
580 JS('void', r'#.$identityHash = #', object, hash); 580 JS('void', r'#.$identityHash = #', object, hash);
581 } 581 }
582 return JS('int', '#', hash); 582 return JS('int', '#', hash);
583 } 583 }
584 584
585 static _throwFormatException(String string) { 585 static Null _throwFormatException(String string) {
vsm 2015/05/26 13:40:58 This feels a bit strange, but see the casts in the
Leaf 2015/05/26 18:19:45 This is a bit odd. I don't understand why Null he
vsm 2015/05/27 13:37:21 Ugh, it turns out that we were reporting an error
Leaf 2015/05/27 22:16:34 I don't understand this either... :} I don't thin
586 throw new FormatException(string); 586 throw new FormatException(string);
587 } 587 }
588 588
589 static int parseInt(String source, 589 static int parseInt(String source,
590 int radix, 590 int radix,
591 int handleError(String source)) { 591 int handleError(String source)) {
592 if (handleError == null) handleError = _throwFormatException; 592 if (handleError == null) handleError = _throwFormatException;
593 593
594 checkString(source); 594 checkString(source);
595 var match = JS('JSExtendableArray|Null', 595 var match = JS('JSExtendableArray|Null',
(...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after
3455 throw new MainError("No top-level function named 'main'."); 3455 throw new MainError("No top-level function named 'main'.");
3456 } 3456 }
3457 3457
3458 void badMain() { 3458 void badMain() {
3459 throw new MainError("'main' is not a function."); 3459 throw new MainError("'main' is not a function.");
3460 } 3460 }
3461 3461
3462 void mainHasTooManyParameters() { 3462 void mainHasTooManyParameters() {
3463 throw new MainError("'main' expects too many parameters."); 3463 throw new MainError("'main' expects too many parameters.");
3464 } 3464 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698