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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_helper.dart

Issue 11304021: Add NativeEnqueuer to work with the Enqueuer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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
Index: sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index 5b4f36a612dd73f37a56a7c035d18e5b31ec40dd..3f13d3e405ead830c2ecd341c219d42720e2c828 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -303,7 +303,8 @@ index$slow(var a, var index) {
if (index < 0 || index >= a.length) {
throw new RangeError.value(index);
}
- return JS('Object', r'#[#]', a, index);
+ // return JS('Object', r'#[#]', a, index);
+ return JS('', r'#[#]', a, index);
}
return UNINTERCEPTED(a[index]);
}
@@ -317,7 +318,7 @@ void indexSet$slow(var a, var index, var value) {
throw new RangeError.value(index);
}
checkMutable(a, 'indexed set');
- JS('Object', r'#[#] = #', a, index, value);
+ JS('void', r'#[#] = #', a, index, value);
return;
}
UNINTERCEPTED(a[index] = value);
@@ -348,7 +349,8 @@ class ListIterator<T> implements Iterator<T> {
bool get hasNext => i < JS('int', r'#.length', list);
T next() {
if (!hasNext) throw new StateError("No more elements");
- var value = JS('Object', r'#[#]', list, i);
+ // var value = JS('Object', r'#[#]', list, i);
+ var value = JS('', r'#[#]', list, i);
i += 1;
return value;
}
@@ -523,11 +525,14 @@ class Primitives {
}
static List newList(length) {
- if (length == null) return JS('Object', r'new Array()');
+ // TODO(sra): For good concrete type analysis we need the JS-type to
+ // specifically name the JavaScript Array implementation. 'List' matches
+ // all the dart:html types that implement List<T>.
+ if (length == null) return JS('List', r'new Array()');
if ((length is !int) || (length < 0)) {
throw new ArgumentError(length);
}
- var result = JS('Object', r'new Array(#)', length);
+ var result = JS('List', r'new Array(#)', length);
JS('void', r'#.fixed$length = #', result, true);
return result;
}
@@ -584,7 +589,8 @@ class Primitives {
}
static patchUpY2K(value, years, isUtc) {
- var date = JS('Object', r'new Date(#)', value);
+ // var date = JS('Object', r'new Date(#)', value);
+ var date = JS('', r'new Date(#)', value);
if (isUtc) {
JS('num', r'#.setUTCFullYear(#)', date, years);
} else {
@@ -896,7 +902,8 @@ class MathNatives {
*/
$throw(ex) {
if (ex == null) ex = const NullPointerException();
- var jsError = JS('Object', r'new Error()');
+ // var jsError = JS('Object', r'new Error()');
+ var jsError = JS('var', r'new Error()');
JS('void', r'#.name = #', jsError, ex);
JS('void', r'#.description = #', jsError, ex);
JS('void', r'#.dartException = #', jsError, ex);
@@ -911,7 +918,8 @@ $throw(ex) {
* JavaScript Error to which we have added a property 'dartException'
* which holds a Dart object.
*/
-toStringWrapper() => JS('Object', r'this.dartException').toString();
+// toStringWrapper() => JS('Object', r'this.dartException').toString();
+toStringWrapper() => JS('', r'this.dartException').toString();
makeLiteralListConst(list) {
JS('bool', r'#.immutable$list = #', list, true);
@@ -939,7 +947,8 @@ unwrapException(ex) {
// Note that we are checking if the object has the property. If it
// has, it could be set to null if the thrown value is null.
if (JS('bool', r'"dartException" in #', ex)) {
- return JS('Object', r'#.dartException', ex);
+ // return JS('Object', r'#.dartException', ex);
+ return JS('', r'#.dartException', ex);
}
// Grab hold of the exception message. This field is available on
@@ -1481,6 +1490,7 @@ Type getOrCreateCachedRuntimeType(String key) {
}
String getRuntimeTypeString(var object) {
- var typeInfo = JS('Object', r'#.builtin$typeInfo', object);
+ //var typeInfo = JS('Object', r'#.builtin$typeInfo', object);
+ var typeInfo = JS('var', r'#.builtin$typeInfo', object);
return JS('String', r'#.runtimeType', typeInfo);
}

Powered by Google App Engine
This is Rietveld 408576698