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

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

Issue 2621543004: Cleanup references to the old DDC repo (Closed)
Patch Set: Linkify issues Created 3 years, 11 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 dart._js_helper; 5 library dart._js_helper;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'dart:_foreign_helper' show 9 import 'dart:_foreign_helper' show
10 JS, 10 JS,
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 int int32a = JS("int", "(Math.random() * 0x100000000) >>> 0"); 871 int int32a = JS("int", "(Math.random() * 0x100000000) >>> 0");
872 int int32b = JS("int", "(Math.random() * 0x100000000) >>> 0"); 872 int int32b = JS("int", "(Math.random() * 0x100000000) >>> 0");
873 return int32a + int32b * 0x100000000; 873 return int32a + int32b * 0x100000000;
874 } 874 }
875 875
876 String jsonEncodeNative(String string) { 876 String jsonEncodeNative(String string) {
877 return JS("String", "JSON.stringify(#)", string); 877 return JS("String", "JSON.stringify(#)", string);
878 } 878 }
879 879
880 880
881 // TODO(jmesserly): this adapter is to work around: 881 // TODO(jmesserly): this adapter is to work around
882 // https://github.com/dart-lang/dev_compiler/issues/247 882 // https://github.com/dart-lang/sdk/issues/28320
883 class SyncIterator<E> implements Iterator<E> { 883 class SyncIterator<E> implements Iterator<E> {
884 final dynamic _jsIterator; 884 final dynamic _jsIterator;
885 E _current; 885 E _current;
886 886
887 SyncIterator(this._jsIterator); 887 SyncIterator(this._jsIterator);
888 888
889 E get current => _current; 889 E get current => _current;
890 890
891 bool moveNext() { 891 bool moveNext() {
892 final ret = JS('', '#.next()', _jsIterator); 892 final ret = JS('', '#.next()', _jsIterator);
(...skipping 12 matching lines...) Expand all
905 // we have no way of telling the compiler yet, so it will generate an extra 905 // we have no way of telling the compiler yet, so it will generate an extra
906 // layer of indirection that wraps the SyncIterator. 906 // layer of indirection that wraps the SyncIterator.
907 _jsIterator() => JS('', '#(...#)', _generator, _args); 907 _jsIterator() => JS('', '#(...#)', _generator, _args);
908 908
909 Iterator<E> get iterator => new SyncIterator<E>(_jsIterator()); 909 Iterator<E> get iterator => new SyncIterator<E>(_jsIterator());
910 } 910 }
911 911
912 class BooleanConversionAssertionError extends AssertionError { 912 class BooleanConversionAssertionError extends AssertionError {
913 toString() => 'Failed assertion: boolean expression must not be null'; 913 toString() => 'Failed assertion: boolean expression must not be null';
914 } 914 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/interceptors.dart ('k') | pkg/dev_compiler/tool/input_sdk/private/native_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698