mirror of https://github.com/lukechilds/node.git
Browse Source
PR-URL: https://github.com/nodejs/node/pull/8852 Reviewed-By: Franziska Hinkelmann <franzih@chromium.org> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>v6
Michaël Zasso
8 years ago
19 changed files with 84 additions and 79 deletions
@ -0,0 +1,22 @@ |
|||
// Copyright 2016 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
|
|||
|
|||
function foo(a) { |
|||
return a.x === a.y; |
|||
} |
|||
|
|||
function A() { } |
|||
|
|||
var o = new A; |
|||
|
|||
var a = {x: o} |
|||
o.x = 0; |
|||
a.y = o; |
|||
|
|||
assertTrue(foo(a)); |
|||
assertTrue(foo(a)); |
|||
%OptimizeFunctionOnNextCall(foo); |
|||
assertTrue(foo(a)); |
@ -0,0 +1,14 @@ |
|||
// Copyright 2016 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
|
|||
|
|||
function f(obj) { |
|||
var key; |
|||
for (key in obj) { } |
|||
return key === undefined; |
|||
} |
|||
|
|||
%OptimizeFunctionOnNextCall(f); |
|||
assertFalse(f({ foo:0 })); |
@ -0,0 +1,17 @@ |
|||
// Copyright 2016 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 --harmony-tailcalls
|
|||
|
|||
function f() { |
|||
"use strict"; |
|||
return undefined(0, 0); |
|||
} |
|||
function g() { |
|||
return f(); |
|||
} |
|||
assertThrows(g, TypeError); |
|||
assertThrows(g, TypeError); |
|||
%OptimizeFunctionOnNextCall(g); |
|||
assertThrows(g, TypeError); |
Loading…
Reference in new issue