diff options
Diffstat (limited to 'deps/v8/test/mjsunit/compiler/array-is-array.js')
-rw-r--r-- | deps/v8/test/mjsunit/compiler/array-is-array.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/compiler/array-is-array.js b/deps/v8/test/mjsunit/compiler/array-is-array.js index 60efa2234b..90785d9f26 100644 --- a/deps/v8/test/mjsunit/compiler/array-is-array.js +++ b/deps/v8/test/mjsunit/compiler/array-is-array.js @@ -110,6 +110,7 @@ assertInstanceof(foo({}), TypeError); })(); +// Packed // Test JSObjectIsArray in JSTypedLowering for the case that the // input value is known to be a non-extensible Array literal. (function() { @@ -151,3 +152,46 @@ %OptimizeFunctionOnNextCall(foo); assertTrue(foo()); })(); + +// Holey +// Test JSObjectIsArray in JSTypedLowering for the case that the +// input value is known to be a non-extensible Array literal. +(function() { + function foo() { + return Array.isArray(Object.preventExtensions([,])); + } + + %PrepareFunctionForOptimization(foo); + assertTrue(foo()); + assertTrue(foo()); + %OptimizeFunctionOnNextCall(foo); + assertTrue(foo()); +})(); + +// Test JSObjectIsArray in JSTypedLowering for the case that the +// input value is known to be a sealed Array literal. +(function() { + function foo() { + return Array.isArray(Object.seal([,])); + } + + %PrepareFunctionForOptimization(foo); + assertTrue(foo()); + assertTrue(foo()); + %OptimizeFunctionOnNextCall(foo); + assertTrue(foo()); +})(); + +// Test JSObjectIsArray in JSTypedLowering for the case that the +// input value is known to be a frozen Array literal. +(function() { + function foo() { + return Array.isArray(Object.freeze([,])); + } + + %PrepareFunctionForOptimization(foo); + assertTrue(foo()); + assertTrue(foo()); + %OptimizeFunctionOnNextCall(foo); + assertTrue(foo()); +})(); |