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

Unified Diff: sdk/lib/js/dart2js/js_dart2js.dart

Issue 51523002: Fix js_test in dart2js checked mode (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698