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

Unified Diff: pkg/dev_compiler/tool/input_sdk/lib/html/html_common/conversions.dart

Issue 2666053004: Remove dynamic call from _LinkedHashSet. Remove some dcalls from the dart:html util library. (Closed)
Patch Set: Remove dynamic call from _LinkedHashSet. Remove some dcalls from the dart:html util library. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/dev_compiler/tool/input_sdk/lib/html/html_common/conversions.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/html/html_common/conversions.dart b/pkg/dev_compiler/tool/input_sdk/lib/html/html_common/conversions.dart
index de0d423258d971447938882f573cc9e49e86fd09..4b2cff37f9fd219189c7fbf0602e3878ab3fa0b6 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/html/html_common/conversions.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/html/html_common/conversions.dart
@@ -76,7 +76,7 @@ abstract class _StructuredClone {
cleanupSlots() {} // Will be needed if we mark objects with a property.
bool cloneNotRequired(object);
newJsMap();
- newJsList(length);
+ List newJsList(length);
void putIntoMap(map, key, value);
// Returns the input, or a clone of the input.
@@ -127,7 +127,7 @@ abstract class _StructuredClone {
// non-native properties or methods from interceptors and such, e.g.
// an immutability marker. So we had to stop doing that.
var slot = findSlot(e);
- var copy = readSlot(slot);
+ var copy = JS('List', '#', readSlot(slot));
if (copy != null) return copy;
copy = copyList(e, slot);
return copy;
@@ -136,7 +136,7 @@ abstract class _StructuredClone {
throw new UnimplementedError('structured clone of other type');
}
- copyList(List e, int slot) {
+ List copyList(List e, int slot) {
int i = 0;
int length = e.length;
var copy = newJsList(length);
@@ -196,11 +196,11 @@ abstract class _AcceptStructuredClone {
writeSlot(int i, x) { copies[i] = x; }
/// Iterate over the JS properties.
- forEachJsField(object, action);
+ forEachJsField(object, action(key, value));
/// Create a new Dart list of the given length. May create a native List or
/// a JsArray, depending if we're in Dartium or dart2js.
- newDartList(length);
+ List newDartList(length);
walk(e) {
if (e == null) return e;
@@ -235,18 +235,19 @@ abstract class _AcceptStructuredClone {
}
if (isJavaScriptArray(e)) {
- var slot = findSlot(e);
- var copy = readSlot(slot);
+ var l = JS('List', '#', e);
+ var slot = findSlot(l);
+ var copy = JS('List', '#', readSlot(slot));
if (copy != null) return copy;
- int length = e.length;
+ int length = l.length;
// Since a JavaScript Array is an instance of Dart List, we can modify it
// in-place unless we must copy.
- copy = mustCopy ? newDartList(length) : e;
+ copy = mustCopy ? newDartList(length) : l;
writeSlot(slot, copy);
for (int i = 0; i < length; i++) {
- copy[i] = walk(e[i]);
+ copy[i] = walk(l[i]);
}
return copy;
}
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/input_sdk/lib/html/html_common/conversions_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698