diff options
Diffstat (limited to 'deps/v8/test/mjsunit/deopt-global-accessor.js')
-rw-r--r-- | deps/v8/test/mjsunit/deopt-global-accessor.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/deopt-global-accessor.js b/deps/v8/test/mjsunit/deopt-global-accessor.js new file mode 100644 index 0000000000..5c544a0fa0 --- /dev/null +++ b/deps/v8/test/mjsunit/deopt-global-accessor.js @@ -0,0 +1,23 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --allow-natives-syntax + +x = 1; +x = 2; +x = 3; + +function f() { + return x; +} + +f(); +f(); +f(); +%OptimizeFunctionOnNextCall(f); +f(); + +Object.defineProperty(this, "x", {get:function() { return 100; }}); + +assertEquals(100, f()); |