Chromium Code Reviews| Index: sdk/lib/js/dart2js/js_dart2js.dart |
| diff --git a/sdk/lib/js/dart2js/js_dart2js.dart b/sdk/lib/js/dart2js/js_dart2js.dart |
| index d92d32f02fe1978fa8370ee626823904bf4276c8..8532c197ddd68c3a42d3d7789d9977c43904956c 100644 |
| --- a/sdk/lib/js/dart2js/js_dart2js.dart |
| +++ b/sdk/lib/js/dart2js/js_dart2js.dart |
| @@ -376,13 +376,17 @@ class JsArray<E> extends JsObject with ListMixin<E> { |
| // Methods required by ListMixin |
| - E operator [](int index) { |
| - _checkIndex(index); |
| + E operator [](index) { |
| + if (index is num && index == index.toInt()) { |
|
Jacob
2013/10/29 22:08:03
can you file a bug to find a better long term solu
justinfagnani
2013/10/30 02:16:36
Done.
|
| + _checkIndex(index); |
| + } |
| return super[index]; |
| } |
| - void operator []=(int index, E value) { |
| - _checkIndex(index); |
| + void operator []=(index, E value) { |
| + if (index is num && index == index.toInt()) { |
| + _checkIndex(index); |
| + } |
| super[index] = value; |
| } |
| @@ -507,6 +511,8 @@ Object _convertToDart(o) { |
| } else if (JS('bool', '# instanceof Date', o)) { |
| var ms = JS('num', '#.getMilliseconds()', o); |
| return new DateTime.fromMillisecondsSinceEpoch(ms); |
| + } else if (JS('bool', '#.constructor === DartObject', o)) { |
| + return JS('', '#.o', o); |
| } else { |
| return _wrapToDart(o); |
| } |
| @@ -519,8 +525,6 @@ JsObject _wrapToDart(o) { |
| } else if (JS('bool', '# instanceof Array', o)) { |
| return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME, |
| (o) => new JsArray._fromJs(o)); |
| - } else if (JS('bool', '#.constructor === DartObject', o)) { |
| - return JS('', '#.o', o); |
| } else { |
| return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME, |
| (o) => new JsObject._fromJs(o)); |