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

Unified Diff: lib/runtime/dart/collection.js

Issue 1071773002: metalet with postfix improvement (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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: lib/runtime/dart/collection.js
diff --git a/lib/runtime/dart/collection.js b/lib/runtime/dart/collection.js
index 1a0ebb176efa5dfc434ad6824fa1540ac1f88531..6edcc2b5daa60c00f7a400d69525cb48e8f21c32 100644
--- a/lib/runtime/dart/collection.js
+++ b/lib/runtime/dart/collection.js
@@ -1505,19 +1505,11 @@ var collection;
return result;
}
[core.$add](element) {
- this[core.$set]((() => {
- let o$ = this, x$ = o$[core.$length];
- o$[core.$length] = dart.notNull(x$) + 1;
- return x$;
- }).bind(this)(), element);
+ this[core.$set](dart.prop(this, 'length').notNull++, element);
}
[core.$addAll](iterable) {
for (let element of iterable) {
- this[core.$set]((() => {
- let o$ = this, x$ = o$[core.$length];
- o$[core.$length] = dart.notNull(x$) + 1;
- return x$;
- }).bind(this)(), element);
+ this[core.$set](dart.prop(this, 'length').notNull++, element);
}
}
[core.$remove](element) {
@@ -1724,8 +1716,7 @@ var collection;
}
if (!(typeof index == 'number'))
throw new core.ArgumentError(index);
- let o$ = this;
- o$[core.$length] = dart.notNull(o$[core.$length]) + 1;
+ dart.prop(this, 'length').notNull++;
this.setRange(dart.notNull(index) + 1, this[core.$length], this, index);
this[core.$set](index, element);
}

Powered by Google App Engine
This is Rietveld 408576698