Skip to content

Commit

Permalink
Fix strong-mode bug in dart2js ConstantMap.from.
Browse files Browse the repository at this point in the history
Fixes 33371.

Bug: http://dartbug.com/33371
Change-Id: I57eeeb2a0eca198c76c3470706648110da45775b
Reviewed-on: https://dart-review.googlesource.com/59082
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
  • Loading branch information
lrhn authored and commit-bot@chromium.org committed Jun 7, 2018
1 parent cf319e4 commit b9381d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sdk/lib/_internal/js_runtime/lib/constant_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ConstantMapView<K, V> extends UnmodifiableMapView<K, V>
abstract class ConstantMap<K, V> implements Map<K, V> {
// Used to create unmodifiable maps from other maps.
factory ConstantMap.from(Map other) {
List keys = other.keys.toList();
List keys = new List<K>.from(other.keys);
bool allStrings = true;
for (var k in keys) {
if (k is! String) {
Expand All @@ -26,7 +26,7 @@ abstract class ConstantMap<K, V> implements Map<K, V> {
var object = JS('=Object', '{}');
int length = 0;
for (var k in keys) {
var v = other[k];
V v = other[k];
if (k != '__proto__') {
if (!jsHasOwnProperty(object, k)) length++;
JS('void', '#[#] = #', object, k, v);
Expand Down
6 changes: 0 additions & 6 deletions tests/corelib_2/corelib_2.status
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ nan_infinity_test/01: RuntimeError
string_split_test/checkedstore: RuntimeError
symbol_reserved_word_test/03: RuntimeError # Issue 19972, new Symbol('void') should be allowed.
uri_base_test: Crash # RangeError (index): Invalid value: Valid value range is empty: 0
uri_parameters_all_test: RuntimeError
uri_test: RuntimeError

[ $compiler == dart2js && $fasta ]
int_from_environment_int64_test: RuntimeError # WontFix: Int not precisely representable in JS
Expand Down Expand Up @@ -254,8 +252,6 @@ regexp/pcre_test: RuntimeError
string_split_test/checkedstore: RuntimeError # Issue 30548: does not check stores into List<String>
symbol_reserved_word_test/03: RuntimeError # Issue 19972, new Symbol('void') should be allowed.
uri_base_test: RuntimeError
uri_parameters_all_test: RuntimeError
uri_test: RuntimeError

[ $compiler == dart2js && $fasta && $minified && $strong ]
cast_test: RuntimeError
Expand All @@ -280,8 +276,6 @@ symbol_operator_test/03: RuntimeError
symbol_operator_test/none: RuntimeError
symbol_reserved_word_test/03: RuntimeError # Issue 19972, new Symbol('void') should be allowed.
uri_base_test: RuntimeError
uri_parameters_all_test: RuntimeError
uri_test: RuntimeError

[ $compiler == dart2js && $fasta && !$strong ]
*: SkipByDesign
Expand Down

0 comments on commit b9381d3

Please sign in to comment.