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

Unified Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Issue 2890873002: dart2js: --fast-startup: updateHolders always copies properties (Closed)
Patch Set: remove unused isChrome Created 3 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
index 5722d129365294500d9c229b4912f46411c6628e..4bb84a18b80d40f99d12322f43887b74d35863ba 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
@@ -60,7 +60,8 @@ const String mainBoilerplate = '''
function copyProperties(from, to) {
var keys = Object.keys(from);
for (var i = 0; i < keys.length; i++) {
- to[keys[i]] = from[keys[i]];
+ var key = keys[i];
+ to[key] = from[key];
}
}
@@ -73,9 +74,6 @@ var functionsHaveName = (function() {
return (typeof t.name == 'string')
})();
-var isChrome = (typeof window != 'undefined') &&
- (typeof window.chrome != 'undefined');
-
// Sets the name property of functions, if the JS engine doesn't set the name
// itself.
// As of 2015 only IE doesn't set the name.
@@ -275,15 +273,7 @@ function updateTypes(newTypes) {
// Updates the given holder with the properties of the [newHolder].
// This function is used when a deferred fragment is initialized.
function updateHolder(holder, newHolder) {
- // Firefox doesn't like when important objects have their prototype chain
- // updated. We therefore do this only on V8.
- if (isChrome) {
- var oldPrototype = holder.__proto__;
- newHolder.__proto__ = oldPrototype;
- holder.__proto__ = newHolder;
- } else {
- copyProperties(newHolder, holder);
- }
+ copyProperties(newHolder, holder);
return holder;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698