Disable the use of __proto__ in incremental mode.

BUG=
TBR=floitsch@google.com

Review URL: https://codereview.chromium.org//1004183002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44460 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
herhut@google.com
2015-03-13 13:07:24 +00:00
parent 8edfda7956
commit 1cf889e24d
@@ -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);