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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 1004183002: Disable the use of __proto__ in incremental mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/old_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index e6caedfe3f6550be2cf9c4bd8cf918602e63f5c2..5ec8552bb673442968484102d7199e7747f7353a 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -1193,15 +1193,23 @@ class OldEmitter implements Emitter {
}
void emitSupportsDirectProtoAccess(CodeOutput output) {
- jsAst.Statement supportsDirectProtoAccess = js.statement(r'''
- var supportsDirectProtoAccess = (function () {
- var cls = function () {};
- cls.prototype = {'p': {}};
- var object = new cls();
- return object.__proto__ &&
- object.__proto__.p === cls.prototype.p;
- })();
- ''');
+ jsAst.Statement supportsDirectProtoAccess;
+
+ if (compiler.hasIncrementalSupport) {
+ supportsDirectProtoAccess = js.statement(r'''
+ var supportsDirectProtoAccess = false;
+ ''');
+ } else {
+ supportsDirectProtoAccess = js.statement(r'''
+ var supportsDirectProtoAccess = (function () {
+ var cls = function () {};
+ cls.prototype = {'p': {}};
+ var object = new cls();
+ return object.__proto__ &&
+ object.__proto__.p === cls.prototype.p;
+ })();
+ ''');
+ }
output.addBuffer(jsAst.prettyPrint(supportsDirectProtoAccess, compiler));
output.add(N);
« 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