Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,46 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test to ensure correct behaviour of Array.array
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Array.isArray([]) is true
PASS Array.isArray(new Array) is true
PASS Array.isArray(Array()) is true
PASS Array.isArray('abc'.match(/(a)*/g)) is true
PASS (function(){ return Array.isArray(arguments); })() is false
PASS Array.isArray() is false
PASS Array.isArray(null) is false
PASS Array.isArray(undefined) is false
PASS Array.isArray(true) is false
PASS Array.isArray(false) is false
PASS Array.isArray('a string') is false
PASS Array.isArray({}) is false
PASS Array.isArray({length: 5}) is false
PASS Array.isArray({__proto__: Array.prototype, length:1, 0:1, 1:2}) is false
PASS successfullyParsed is true
TEST COMPLETE

39
deps/v8/test/webkit/Array-isArray.js vendored Normal file
View File

@ -0,0 +1,39 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Test to ensure correct behaviour of Array.array");
shouldBeTrue("Array.isArray([])");
shouldBeTrue("Array.isArray(new Array)");
shouldBeTrue("Array.isArray(Array())");
shouldBeTrue("Array.isArray('abc'.match(/(a)*/g))");
shouldBeFalse("(function(){ return Array.isArray(arguments); })()");
shouldBeFalse("Array.isArray()");
shouldBeFalse("Array.isArray(null)");
shouldBeFalse("Array.isArray(undefined)");
shouldBeFalse("Array.isArray(true)");
shouldBeFalse("Array.isArray(false)");
shouldBeFalse("Array.isArray('a string')");
shouldBeFalse("Array.isArray({})");
shouldBeFalse("Array.isArray({length: 5})");
shouldBeFalse("Array.isArray({__proto__: Array.prototype, length:1, 0:1, 1:2})");

16
deps/v8/test/webkit/BUILD.gn vendored Normal file
View File

@ -0,0 +1,16 @@
# Copyright 2018 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.
group("v8_webkit") {
testonly = true
data_deps = [
"../..:d8",
"../../tools:v8_testrunner",
]
data = [
"./",
]
}

View File

@ -0,0 +1,58 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test to ensure correct behaviour of replacer functions in JSON.stringify
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS JSON.stringify(object, returnUndefined) is undefined.
PASS JSON.stringify(array, returnUndefined) is undefined.
PASS JSON.stringify(object, returnObjectFor1) is '{"0":0,"1":{},"2":2}'
PASS JSON.stringify(array, returnObjectFor1) is '[0,{},2,null]'
PASS JSON.stringify(object, returnArrayFor1) is '{"0":0,"1":[],"2":2}'
PASS JSON.stringify(array, returnArrayFor1) is '[0,[],2,null]'
PASS JSON.stringify(object, returnUndefinedFor1) is '{"0":0,"2":2}'
PASS JSON.stringify(array, returnUndefinedFor1) is '[0,null,2,null]'
PASS JSON.stringify(object, returnFunctionFor1) is '{"0":0,"2":2}'
PASS JSON.stringify(array, returnFunctionFor1) is '[0,null,2,null]'
PASS JSON.stringify(object, returnNullFor1) is '{"0":0,"1":null,"2":2}'
PASS JSON.stringify(array, returnNullFor1) is '[0,null,2,null]'
PASS JSON.stringify(object, returnStringForUndefined) is '{"0":0,"1":1,"2":2,"3":"undefined value"}'
PASS JSON.stringify(array, returnStringForUndefined) is '[0,1,2,"undefined value"]'
PASS JSON.stringify(object, returnCycleObjectFor1) threw exception TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
--- property '1' closes the circle.
PASS JSON.stringify(array, returnCycleObjectFor1) threw exception TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
--- property '1' closes the circle.
PASS JSON.stringify(object, returnCycleArrayFor1) threw exception TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Array'
--- index 1 closes the circle.
PASS JSON.stringify(array, returnCycleArrayFor1) threw exception TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Array'
--- index 1 closes the circle.
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,95 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Test to ensure correct behaviour of replacer functions in JSON.stringify");
var object = {0:0, 1:1, 2:2, 3:undefined};
var array = [0, 1, 2, undefined];
function returnUndefined(){}
function returnObjectFor1(k, v) {
if (k == "1")
return {};
return v;
}
function returnArrayFor1(k, v) {
if (k == "1")
return [];
return v;
}
function returnUndefinedFor1(k, v) {
if (k == "1")
return undefined;
return v;
}
function returnNullFor1(k, v) {
if (k == "1")
return null;
return v;
}
function returnCycleObjectFor1(k, v) {
if (k == "1")
return object;
return v;
}
function returnCycleArrayFor1(k, v) {
if (k == "1")
return array;
return v;
}
function returnFunctionFor1(k, v) {
if (k == "1")
return function(){};
return v;
}
function returnStringForUndefined(k, v) {
if (v === undefined)
return "undefined value";
return v;
}
shouldBeUndefined("JSON.stringify(object, returnUndefined)");
shouldBeUndefined("JSON.stringify(array, returnUndefined)");
shouldBe("JSON.stringify(object, returnObjectFor1)", '\'{"0":0,"1":{},"2":2}\'');
shouldBe("JSON.stringify(array, returnObjectFor1)", '\'[0,{},2,null]\'');
shouldBe("JSON.stringify(object, returnArrayFor1)", '\'{"0":0,"1":[],"2":2}\'');
shouldBe("JSON.stringify(array, returnArrayFor1)", '\'[0,[],2,null]\'');
shouldBe("JSON.stringify(object, returnUndefinedFor1)", '\'{"0":0,"2":2}\'');
shouldBe("JSON.stringify(array, returnUndefinedFor1)", '\'[0,null,2,null]\'');
shouldBe("JSON.stringify(object, returnFunctionFor1)", '\'{"0":0,"2":2}\'');
shouldBe("JSON.stringify(array, returnFunctionFor1)", '\'[0,null,2,null]\'');
shouldBe("JSON.stringify(object, returnNullFor1)", '\'{"0":0,"1":null,"2":2}\'');
shouldBe("JSON.stringify(array, returnNullFor1)", '\'[0,null,2,null]\'');
shouldBe("JSON.stringify(object, returnStringForUndefined)", '\'{"0":0,"1":1,"2":2,"3":"undefined value"}\'');
shouldBe("JSON.stringify(array, returnStringForUndefined)", '\'[0,1,2,"undefined value"]\'');
shouldThrow("JSON.stringify(object, returnCycleObjectFor1)");
shouldThrow("JSON.stringify(array, returnCycleObjectFor1)");
shouldThrow("JSON.stringify(object, returnCycleArrayFor1)");
shouldThrow("JSON.stringify(array, returnCycleArrayFor1)");

View File

@ -0,0 +1,48 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test to ensure correct behaviour of Object.defineProperties
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.create() threw exception TypeError: Object prototype may only be an Object or null: undefined.
PASS Object.create('a string') threw exception TypeError: Object prototype may only be an Object or null: a string.
PASS Object.create({}, 'a string') threw exception TypeError: Property description must be an object: a.
PASS Object.create(null, 'a string') threw exception TypeError: Property description must be an object: a.
PASS JSON.stringify(Object.create(null,{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}'
PASS JSON.stringify(Object.create({},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}'
PASS JSON.stringify(Object.create({},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}})) is '{"property2":"foo"}'
PASS JSON.stringify(Object.create(null,{property:{value:'foo'}, property2:{value:'foo', enumerable:true}})) is '{"property2":"foo"}'
PASS Object.getPrototypeOf(Object.create(Array.prototype)) is Array.prototype
PASS Object.getPrototypeOf(Object.create(null)) is null
PASS Object.create(null, DescriptorWithValueGetter).foo is true
PASS Object.create(null, DescriptorWithEnumerableGetter).foo is true
PASS Object.create(null, DescriptorWithConfigurableGetter).foo is true
PASS Object.create(null, DescriptorWithWritableGetter).foo is true
PASS Object.create(null, DescriptorWithGetGetter).foo is true
PASS Object.create(null, DescriptorWithSetGetter).foo is true
PASS successfullyParsed is true
TEST COMPLETE

48
deps/v8/test/webkit/Object-create.js vendored Normal file
View File

@ -0,0 +1,48 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Test to ensure correct behaviour of Object.defineProperties");
shouldThrow("Object.create()");
shouldThrow("Object.create('a string')");
shouldThrow("Object.create({}, 'a string')");
shouldThrow("Object.create(null, 'a string')");
shouldBe("JSON.stringify(Object.create(null,{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}}))", '\'{"property":"foo","property2":"foo"}\'');
shouldBe("JSON.stringify(Object.create({},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}}))", '\'{"property":"foo","property2":"foo"}\'');
shouldBe("JSON.stringify(Object.create({},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}}))", '\'{"property2":"foo"}\'');
shouldBe("JSON.stringify(Object.create(null,{property:{value:'foo'}, property2:{value:'foo', enumerable:true}}))", '\'{"property2":"foo"}\'');
shouldBe("Object.getPrototypeOf(Object.create(Array.prototype))", "Array.prototype");
shouldBe("Object.getPrototypeOf(Object.create(null))", "null");
function valueGet() { return true; }
var DescriptorWithValueGetter = { foo: Object.create(null, { value: { get: valueGet }})};
var DescriptorWithEnumerableGetter = { foo: Object.create(null, { value: {value: true}, enumerable: { get: valueGet }})};
var DescriptorWithConfigurableGetter = { foo: Object.create(null, { value: {value: true}, configurable: { get: valueGet }})};
var DescriptorWithWritableGetter = { foo: Object.create(null, { value: {value: true}, writable: { get: valueGet }})};
var DescriptorWithGetGetter = { foo: Object.create(null, { get: { get: function() { return valueGet } }})};
var DescriptorWithSetGetter = { foo: Object.create(null, { get: { value: valueGet}, set: { get: function(){ return valueGet; } }})};
shouldBeTrue("Object.create(null, DescriptorWithValueGetter).foo");
shouldBeTrue("Object.create(null, DescriptorWithEnumerableGetter).foo");
shouldBeTrue("Object.create(null, DescriptorWithConfigurableGetter).foo");
shouldBeTrue("Object.create(null, DescriptorWithWritableGetter).foo");
shouldBeTrue("Object.create(null, DescriptorWithGetGetter).foo");
shouldBeTrue("Object.create(null, DescriptorWithSetGetter).foo");

View File

@ -0,0 +1,42 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test to ensure correct behaviour of Object.defineProperties
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.defineProperties() threw exception TypeError: Object.defineProperties called on non-object.
PASS Object.defineProperties('a string') threw exception TypeError: Object.defineProperties called on non-object.
PASS Object.defineProperties({}, 'a string') threw exception TypeError: Property description must be an object: a.
PASS JSON.stringify(Object.defineProperties({},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}'
PASS JSON.stringify(Object.defineProperties({},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}})) is '{"property2":"foo"}'
PASS JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}'
PASS JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo', enumerable:false}, property2:{value:'foo', enumerable:true}})) is '{"property2":"foo"}'
PASS JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}'
PASS Object.defineProperties(emptyObject, {foo:{value: true}, bar:{get:function(){}, writable:true}}) threw exception TypeError: Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #<Object>.
PASS 'foo' in emptyObject is false
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,36 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Test to ensure correct behaviour of Object.defineProperties");
shouldThrow("Object.defineProperties()");
shouldThrow("Object.defineProperties('a string')");
shouldThrow("Object.defineProperties({}, 'a string')");
shouldBe("JSON.stringify(Object.defineProperties({},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}}))", '\'{"property":"foo","property2":"foo"}\'');
shouldBe("JSON.stringify(Object.defineProperties({},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}}))", '\'{"property2":"foo"}\'');
shouldBe("JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}}))", '\'{"property":"foo","property2":"foo"}\'');
shouldBe("JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo', enumerable:false}, property2:{value:'foo', enumerable:true}}))", '\'{"property2":"foo"}\'');
shouldBe("JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}}))", '\'{"property":"foo","property2":"foo"}\'');
emptyObject={};
shouldThrow("Object.defineProperties(emptyObject, {foo:{value: true}, bar:{get:function(){}, writable:true}})");
shouldBeFalse("'foo' in emptyObject");

View File

@ -0,0 +1,43 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test to ensure correct behaviour of Object.keys
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.keys({}) is []
PASS Object.keys({a:null}) is ['a']
PASS Object.keys({a:null, b:null}) is ['a', 'b']
PASS Object.keys({b:null, a:null}) is ['b', 'a']
PASS Object.keys([]) is []
PASS Object.keys([null]) is ['0']
PASS Object.keys([null,null]) is ['0','1']
PASS Object.keys([null,null,,,,null]) is ['0','1','5']
PASS Object.keys({__proto__:{a:null}}) is []
PASS Object.keys({__proto__:[1,2,3]}) is []
PASS x=[];x.__proto__=[1,2,3];Object.keys(x) is []
PASS successfullyParsed is true
TEST COMPLETE

36
deps/v8/test/webkit/Object-keys.js vendored Normal file
View File

@ -0,0 +1,36 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Test to ensure correct behaviour of Object.keys");
shouldBe("Object.keys({})", "[]");
shouldBe("Object.keys({a:null})", "['a']");
shouldBe("Object.keys({a:null, b:null})", "['a', 'b']");
shouldBe("Object.keys({b:null, a:null})", "['b', 'a']");
shouldBe("Object.keys([])", "[]");
shouldBe("Object.keys([null])", "['0']");
shouldBe("Object.keys([null,null])", "['0','1']");
shouldBe("Object.keys([null,null,,,,null])", "['0','1','5']");
shouldBe("Object.keys({__proto__:{a:null}})", "[]");
shouldBe("Object.keys({__proto__:[1,2,3]})", "[]");
shouldBe("x=[];x.__proto__=[1,2,3];Object.keys(x)", "[]");

View File

@ -0,0 +1,170 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test the JavaScript ToNumber operation.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS +undefined is NaN
PASS +null is 0
PASS +false is 0
PASS +true is 1
PASS +2 is 2
PASS +'' is 0
PASS +' ' is 0
PASS +' 1' is 1
PASS +'1 ' is 1
PASS +'x1' is NaN
PASS +'1x' is NaN
PASS +'0x1' is 1
PASS +'1x0' is NaN
PASS +(nullCharacter + '1') is NaN
PASS +('1' + nullCharacter) is NaN
PASS +('1' + nullCharacter + '1') is NaN
PASS +(nonASCIICharacter + '1') is NaN
PASS +('1' + nonASCIICharacter) is NaN
PASS +('1' + nonASCIICharacter + '1') is NaN
PASS +('1' + nonASCIINonSpaceCharacter) is NaN
PASS +(nonASCIINonSpaceCharacter + '1') is NaN
PASS +('1' + nonASCIINonSpaceCharacter + '1') is NaN
PASS +(illegalUTF16Sequence + '1') is NaN
PASS +('1' + illegalUTF16Sequence) is NaN
PASS +('1' + illegalUTF16Sequence + '1') is NaN
PASS +'inf' is NaN
PASS +'infinity' is NaN
PASS +'Inf' is NaN
PASS +'+inf' is NaN
PASS +'+infinity' is NaN
PASS +'+Inf' is NaN
PASS +'-inf' is NaN
PASS +'-infinity' is NaN
PASS +'-Inf' is NaN
PASS +'Infinity' is Infinity
PASS +'+Infinity' is Infinity
PASS +'-Infinity' is -Infinity
PASS +'++1' is NaN
PASS +'AB' is NaN
PASS +'0xAB' is 171
PASS +'1e1' is 10
PASS +'1E1' is 10
PASS +tab is 0
PASS +nbsp is 0
PASS +ff is 0
PASS +vt is 0
PASS +cr is 0
PASS +lf is 0
PASS +ls is 0
PASS +ps is 0
PASS +oghamSpaceMark is 0
PASS +mongolianVowelSeparator is NaN
PASS +enQuad is 0
PASS +emQuad is 0
PASS +enSpace is 0
PASS +emSpace is 0
PASS +threePerEmSpace is 0
PASS +fourPerEmSpace is 0
PASS +sixPerEmSpace is 0
PASS +figureSpace is 0
PASS +punctuationSpace is 0
PASS +thinSpace is 0
PASS +hairSpace is 0
PASS +narrowNoBreakSpace is 0
PASS +mediumMathematicalSpace is 0
PASS +ideographicSpace is 0
PASS +(tab + '1') is 1
PASS +(nbsp + '1') is 1
PASS +(ff + '1') is 1
PASS +(vt + '1') is 1
PASS +(cr + '1') is 1
PASS +(lf + '1') is 1
PASS +(ls + '1') is 1
PASS +(ps + '1') is 1
PASS +(oghamSpaceMark + '1') is 1
PASS +(mongolianVowelSeparator + '1') is NaN
PASS +(enQuad + '1') is 1
PASS +(emQuad + '1') is 1
PASS +(enSpace + '1') is 1
PASS +(emSpace + '1') is 1
PASS +(threePerEmSpace + '1') is 1
PASS +(fourPerEmSpace + '1') is 1
PASS +(sixPerEmSpace + '1') is 1
PASS +(figureSpace + '1') is 1
PASS +(punctuationSpace + '1') is 1
PASS +(thinSpace + '1') is 1
PASS +(hairSpace + '1') is 1
PASS +(narrowNoBreakSpace + '1') is 1
PASS +(mediumMathematicalSpace + '1') is 1
PASS +(ideographicSpace + '1') is 1
PASS +('1' + tab) is 1
PASS +('1' + nbsp) is 1
PASS +('1' + ff) is 1
PASS +('1' + vt) is 1
PASS +('1' + cr) is 1
PASS +('1' + lf) is 1
PASS +('1' + ls) is 1
PASS +('1' + ps) is 1
PASS +('1' + oghamSpaceMark) is 1
PASS +('1' + mongolianVowelSeparator) is NaN
PASS +('1' + enQuad) is 1
PASS +('1' + emQuad) is 1
PASS +('1' + enSpace) is 1
PASS +('1' + emSpace) is 1
PASS +('1' + threePerEmSpace) is 1
PASS +('1' + fourPerEmSpace) is 1
PASS +('1' + sixPerEmSpace) is 1
PASS +('1' + figureSpace) is 1
PASS +('1' + punctuationSpace) is 1
PASS +('1' + thinSpace) is 1
PASS +('1' + hairSpace) is 1
PASS +('1' + narrowNoBreakSpace) is 1
PASS +('1' + mediumMathematicalSpace) is 1
PASS +('1' + ideographicSpace) is 1
PASS +('1' + tab + '1') is NaN
PASS +('1' + nbsp + '1') is NaN
PASS +('1' + ff + '1') is NaN
PASS +('1' + vt + '1') is NaN
PASS +('1' + cr + '1') is NaN
PASS +('1' + lf + '1') is NaN
PASS +('1' + ls + '1') is NaN
PASS +('1' + ps + '1') is NaN
PASS +('1' + oghamSpaceMark + '1') is NaN
PASS +('1' + mongolianVowelSeparator + '1') is NaN
PASS +('1' + enQuad + '1') is NaN
PASS +('1' + emQuad + '1') is NaN
PASS +('1' + enSpace + '1') is NaN
PASS +('1' + emSpace + '1') is NaN
PASS +('1' + threePerEmSpace + '1') is NaN
PASS +('1' + fourPerEmSpace + '1') is NaN
PASS +('1' + sixPerEmSpace + '1') is NaN
PASS +('1' + figureSpace + '1') is NaN
PASS +('1' + punctuationSpace + '1') is NaN
PASS +('1' + thinSpace + '1') is NaN
PASS +('1' + hairSpace + '1') is NaN
PASS +('1' + narrowNoBreakSpace + '1') is NaN
PASS +('1' + mediumMathematicalSpace + '1') is NaN
PASS +('1' + ideographicSpace + '1') is NaN
PASS successfullyParsed is true
TEST COMPLETE

194
deps/v8/test/webkit/ToNumber.js vendored Normal file
View File

@ -0,0 +1,194 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Test the JavaScript ToNumber operation.')
var nullCharacter = String.fromCharCode(0);
var nonASCIICharacter = String.fromCharCode(0x100);
var nonASCIINonSpaceCharacter = String.fromCharCode(0x13A0);
var illegalUTF16Sequence = String.fromCharCode(0xD800);
var tab = String.fromCharCode(9);
var nbsp = String.fromCharCode(0xA0);
var ff = String.fromCharCode(0xC);
var vt = String.fromCharCode(0xB);
var cr = String.fromCharCode(0xD);
var lf = String.fromCharCode(0xA);
var ls = String.fromCharCode(0x2028);
var ps = String.fromCharCode(0x2029);
var oghamSpaceMark = String.fromCharCode(0x1680);
var mongolianVowelSeparator = String.fromCharCode(0x180E);
var enQuad = String.fromCharCode(0x2000);
var emQuad = String.fromCharCode(0x2001);
var enSpace = String.fromCharCode(0x2002);
var emSpace = String.fromCharCode(0x2003);
var threePerEmSpace = String.fromCharCode(0x2004);
var fourPerEmSpace = String.fromCharCode(0x2005);
var sixPerEmSpace = String.fromCharCode(0x2006);
var figureSpace = String.fromCharCode(0x2007);
var punctuationSpace = String.fromCharCode(0x2008);
var thinSpace = String.fromCharCode(0x2009);
var hairSpace = String.fromCharCode(0x200A);
var narrowNoBreakSpace = String.fromCharCode(0x202F);
var mediumMathematicalSpace = String.fromCharCode(0x205F);
var ideographicSpace = String.fromCharCode(0x3000);
shouldBe("+undefined", "NaN");
shouldBe("+null", "0");
shouldBe("+false", "0");
shouldBe("+true", "1");
shouldBe("+2", "2");
shouldBe("+''", "0");
shouldBe("+' '", "0");
shouldBe("+' 1'", "1");
shouldBe("+'1 '", "1");
shouldBe("+'x1'", "NaN");
shouldBe("+'1x'", "NaN");
shouldBe("+'0x1'", "1");
shouldBe("+'1x0'", "NaN");
shouldBe("+(nullCharacter + '1')", "NaN");
shouldBe("+('1' + nullCharacter)", "NaN");
shouldBe("+('1' + nullCharacter + '1')", "NaN");
shouldBe("+(nonASCIICharacter + '1')", "NaN");
shouldBe("+('1' + nonASCIICharacter)", "NaN");
shouldBe("+('1' + nonASCIICharacter + '1')", "NaN");
shouldBe("+('1' + nonASCIINonSpaceCharacter)", "NaN");
shouldBe("+(nonASCIINonSpaceCharacter + '1')", "NaN");
shouldBe("+('1' + nonASCIINonSpaceCharacter + '1')", "NaN");
shouldBe("+(illegalUTF16Sequence + '1')", "NaN");
shouldBe("+('1' + illegalUTF16Sequence)", "NaN");
shouldBe("+('1' + illegalUTF16Sequence + '1')", "NaN");
shouldBe("+'inf'", "NaN");
shouldBe("+'infinity'", "NaN");
shouldBe("+'Inf'", "NaN");
shouldBe("+'+inf'", "NaN");
shouldBe("+'+infinity'", "NaN");
shouldBe("+'+Inf'", "NaN");
shouldBe("+'-inf'", "NaN");
shouldBe("+'-infinity'", "NaN");
shouldBe("+'-Inf'", "NaN");
shouldBe("+'Infinity'", "Infinity");
shouldBe("+'+Infinity'", "Infinity");
shouldBe("+'-Infinity'", "-Infinity");
shouldBe("+'++1'", "NaN");
shouldBe("+'AB'", "NaN");
shouldBe("+'0xAB'", "171");
shouldBe("+'1e1'", "10");
shouldBe("+'1E1'", "10");
shouldBe("+tab", "0");
shouldBe("+nbsp", "0");
shouldBe("+ff", "0");
shouldBe("+vt", "0");
shouldBe("+cr", "0");
shouldBe("+lf", "0");
shouldBe("+ls", "0");
shouldBe("+ps", "0");
shouldBe("+oghamSpaceMark", "0");
shouldBe("+mongolianVowelSeparator", "NaN");
shouldBe("+enQuad", "0");
shouldBe("+emQuad", "0");
shouldBe("+enSpace", "0");
shouldBe("+emSpace", "0");
shouldBe("+threePerEmSpace", "0");
shouldBe("+fourPerEmSpace", "0");
shouldBe("+sixPerEmSpace", "0");
shouldBe("+figureSpace", "0");
shouldBe("+punctuationSpace", "0");
shouldBe("+thinSpace", "0");
shouldBe("+hairSpace", "0");
shouldBe("+narrowNoBreakSpace", "0");
shouldBe("+mediumMathematicalSpace", "0");
shouldBe("+ideographicSpace", "0");
shouldBe("+(tab + '1')", "1");
shouldBe("+(nbsp + '1')", "1");
shouldBe("+(ff + '1')", "1");
shouldBe("+(vt + '1')", "1");
shouldBe("+(cr + '1')", "1");
shouldBe("+(lf + '1')", "1");
shouldBe("+(ls + '1')", "1");
shouldBe("+(ps + '1')", "1");
shouldBe("+(oghamSpaceMark + '1')", "1");
shouldBe("+(mongolianVowelSeparator + '1')", "NaN");
shouldBe("+(enQuad + '1')", "1");
shouldBe("+(emQuad + '1')", "1");
shouldBe("+(enSpace + '1')", "1");
shouldBe("+(emSpace + '1')", "1");
shouldBe("+(threePerEmSpace + '1')", "1");
shouldBe("+(fourPerEmSpace + '1')", "1");
shouldBe("+(sixPerEmSpace + '1')", "1");
shouldBe("+(figureSpace + '1')", "1");
shouldBe("+(punctuationSpace + '1')", "1");
shouldBe("+(thinSpace + '1')", "1");
shouldBe("+(hairSpace + '1')", "1");
shouldBe("+(narrowNoBreakSpace + '1')", "1");
shouldBe("+(mediumMathematicalSpace + '1')", "1");
shouldBe("+(ideographicSpace + '1')", "1");
shouldBe("+('1' + tab)", "1");
shouldBe("+('1' + nbsp)", "1");
shouldBe("+('1' + ff)", "1");
shouldBe("+('1' + vt)", "1");
shouldBe("+('1' + cr)", "1");
shouldBe("+('1' + lf)", "1");
shouldBe("+('1' + ls)", "1");
shouldBe("+('1' + ps)", "1");
shouldBe("+('1' + oghamSpaceMark)", "1");
shouldBe("+('1' + mongolianVowelSeparator)", "NaN");
shouldBe("+('1' + enQuad)", "1");
shouldBe("+('1' + emQuad)", "1");
shouldBe("+('1' + enSpace)", "1");
shouldBe("+('1' + emSpace)", "1");
shouldBe("+('1' + threePerEmSpace)", "1");
shouldBe("+('1' + fourPerEmSpace)", "1");
shouldBe("+('1' + sixPerEmSpace)", "1");
shouldBe("+('1' + figureSpace)", "1");
shouldBe("+('1' + punctuationSpace)", "1");
shouldBe("+('1' + thinSpace)", "1");
shouldBe("+('1' + hairSpace)", "1");
shouldBe("+('1' + narrowNoBreakSpace)", "1");
shouldBe("+('1' + mediumMathematicalSpace)", "1");
shouldBe("+('1' + ideographicSpace)", "1");
shouldBe("+('1' + tab + '1')", "NaN");
shouldBe("+('1' + nbsp + '1')", "NaN");
shouldBe("+('1' + ff + '1')", "NaN");
shouldBe("+('1' + vt + '1')", "NaN");
shouldBe("+('1' + cr + '1')", "NaN");
shouldBe("+('1' + lf + '1')", "NaN");
shouldBe("+('1' + ls + '1')", "NaN");
shouldBe("+('1' + ps + '1')", "NaN");
shouldBe("+('1' + oghamSpaceMark + '1')", "NaN");
shouldBe("+('1' + mongolianVowelSeparator + '1')", "NaN");
shouldBe("+('1' + enQuad + '1')", "NaN");
shouldBe("+('1' + emQuad + '1')", "NaN");
shouldBe("+('1' + enSpace + '1')", "NaN");
shouldBe("+('1' + emSpace + '1')", "NaN");
shouldBe("+('1' + threePerEmSpace + '1')", "NaN");
shouldBe("+('1' + fourPerEmSpace + '1')", "NaN");
shouldBe("+('1' + sixPerEmSpace + '1')", "NaN");
shouldBe("+('1' + figureSpace + '1')", "NaN");
shouldBe("+('1' + punctuationSpace + '1')", "NaN");
shouldBe("+('1' + thinSpace + '1')", "NaN");
shouldBe("+('1' + hairSpace + '1')", "NaN");
shouldBe("+('1' + narrowNoBreakSpace + '1')", "NaN");
shouldBe("+('1' + mediumMathematicalSpace + '1')", "NaN");
shouldBe("+('1' + ideographicSpace + '1')", "NaN");

View File

@ -0,0 +1,37 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that speculation recovery of destructive additions on unboxed integers works.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS destructiveAddForBoxedInteger({x:1}, 2, 4) is 9
PASS destructiveAddForBoxedInteger({x:2147483647}, 2, 4) is 2147483655
PASS destructiveAddForBoxedInteger({x:2}, 2147483647, 4) is 4294967300
PASS destructiveAddForBoxedInteger({x:2147483647}, 2147483647, 4) is 6442450945
PASS destructiveAddForBoxedInteger({x:1}, 2, 2147483647) is 2147483652
PASS successfullyParsed is true
TEST COMPLETE

43
deps/v8/test/webkit/add-recovery.js vendored Normal file
View File

@ -0,0 +1,43 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that speculation recovery of destructive additions on unboxed integers works."
);
function destructiveAddForBoxedInteger(a,b,c) {
var a_ = a.x;
var d = a_ + b;
return c + d + b;
}
// warm-up foo to be integer
for (var i = 0; i < 100; ++i) {
destructiveAddForBoxedInteger({x:1}, 2, 3);
}
shouldBe("destructiveAddForBoxedInteger({x:1}, 2, 4)", "9");
shouldBe("destructiveAddForBoxedInteger({x:2147483647}, 2, 4)", "2147483655");
shouldBe("destructiveAddForBoxedInteger({x:2}, 2147483647, 4)", "4294967300");
shouldBe("destructiveAddForBoxedInteger({x:2147483647}, 2147483647, 4)", "6442450945");
shouldBe("destructiveAddForBoxedInteger({x:1}, 2, 2147483647)", "2147483652");

View File

@ -0,0 +1,41 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test that we properly fill in missing args with "undefined" in JIT code.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS caller(0) is undefined
PASS caller(1) is undefined
PASS caller(2) is undefined
PASS caller(3) is undefined
PASS caller(4) is undefined
PASS caller(5) is undefined
PASS caller(6) is undefined
PASS caller(7) is undefined
PASS caller(8) is undefined
PASS successfullyParsed is true
TEST COMPLETE

97
deps/v8/test/webkit/apply-varargs.js vendored Normal file
View File

@ -0,0 +1,97 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Test that we properly fill in missing args with "undefined" in JIT code.');
// Regression test for <rdar://problem/10763509>
function callee(a1, a2, a3, a4, a5, a6, a7, a8)
{
// We expect that the unused actual parameters will be filled
// with undefined.
if (a1 !== undefined)
return "Arg1 is wrong";
if (a2 !== undefined)
return "Arg2 is wrong";
if (a3 !== undefined)
return "Arg3 is wrong";
if (a4 !== undefined)
return "Arg4 is wrong";
if (a5 !== undefined)
return "Arg5 is wrong";
if (a6 !== undefined)
return "Arg6 is wrong";
if (a7 !== undefined)
return "Arg7 is wrong";
if (a8 !== undefined)
return "Arg8 is wrong";
return undefined;
}
function dummy(a1, a2, a3, a4, a5, a6, a7, a8)
{
}
function BaseObj()
{
}
function caller(testArgCount)
{
var baseObj = new BaseObj();
var allArgs = [0, "String", callee, true, null, 2.5, [1, 2, 3], {'a': 1, 'b' : 2}];
argCounts = [8, testArgCount];
for (argCountIndex = 0; argCountIndex < argCounts.length; argCountIndex++) {
argCount = argCounts[argCountIndex];
var varArgs = [];
for (i = 0; i < argCount; i++)
varArgs[i] = undefined;
for (numCalls = 0; numCalls < 10; numCalls++) {
// Run multiple times so that the JIT kicks in
dummy.apply(baseObj, allArgs);
var result = callee.apply(baseObj, varArgs);
if (result != undefined)
return result;
}
}
return undefined;
}
shouldBe("caller(0)", 'undefined');
shouldBe("caller(1)", 'undefined');
shouldBe("caller(2)", 'undefined');
shouldBe("caller(3)", 'undefined');
shouldBe("caller(4)", 'undefined');
shouldBe("caller(5)", 'undefined');
shouldBe("caller(6)", 'undefined');
shouldBe("caller(7)", 'undefined');
shouldBe("caller(8)", 'undefined');
var successfullyParsed = true;

View File

@ -0,0 +1,36 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks whether arguments crashes when passed a bad index.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS indexArguments(1, "a") is "a"
PASS indexArguments("1 ", "a") is undefined
PASS indexArguments(0xDEADBEEF) is undefined
PASS indexArguments(0xFFFFFFFF) is undefined
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,36 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks whether arguments crashes when passed a bad index."
);
function indexArguments(index)
{
return arguments[index];
}
shouldBe('indexArguments(1, "a")', '"a"');
shouldBe('indexArguments("1 ", "a")', 'undefined');
shouldBe('indexArguments(0xDEADBEEF)', 'undefined');
shouldBe('indexArguments(0xFFFFFFFF)', 'undefined');

View File

@ -0,0 +1,38 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that array construction via a host call works.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS array instanceof Array is true
PASS array.length is 100
PASS array instanceof Array is true
PASS array.length is 100
PASS array instanceof Array is true
PASS array.length is 100
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,36 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that array construction via a host call works."
);
function constructArray(arrayConstructor) {
return new arrayConstructor(100);
}
for (var i = 0; i < 3; ++i) {
var array = constructArray(Array);
shouldBeTrue("array instanceof Array");
shouldBe("array.length", "100");
}

View File

@ -0,0 +1,67 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks the behavior of [[DefineOwnProperty]] applied to Array objects (see ES5.1 15.4.5.1).
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.defineProperty([], 'x', { get:function(){return true;} }).x is true
PASS Object.defineProperty([], 'length', { value: 1 }).length is 1
PASS var a = Object.defineProperty([], 'length', { writable: false }); a[1] = 1; a.length is 0
PASS var a = Object.defineProperty([], 'length', { writable: false }); a.length = 1; a.length is 0
PASS var a = Object.defineProperty([], 'length', {}); a.length = 1; a.length is 1
PASS Object.defineProperty([], 'length', { get:function(){return true;} }) threw exception TypeError: Cannot redefine property: length.
PASS Object.defineProperty([], 'length', { enumerable: true }) threw exception TypeError: Cannot redefine property: length.
PASS Object.defineProperty([], 'length', { configurable: true }) threw exception TypeError: Cannot redefine property: length.
PASS Object.defineProperty(Object.defineProperty([], 'length', { writable: false }), 'length', { writable: true }) threw exception TypeError: Cannot redefine property: length.
PASS var a = Object.defineProperty([], '0', { value: 42 }); a[0] is 42
PASS var a = Object.defineProperty([42], '0', { writable: false }); a[0] = 1; a[0] is 42
PASS var a = Object.defineProperty([42], '0', { enumerable: false }); a[0] + Object.keys(a).length is 42
PASS var a = Object.defineProperty([42], '0', { configurable: false }); a.length = 0; a[0] is 42
PASS var foo = 0; Object.defineProperty([], '0', { set:function(x){foo = x;} })[0] = 42; foo is 42
PASS Object.defineProperty([], '0', { get:function(){return true;} })[0] is true
PASS Object.defineProperty(Object.defineProperty([true], '0', { configurable:true, writable: false }), '0', { writable: true })[0] is true
PASS Object.defineProperty(Object.defineProperty([true], '0', { configurable:false, writable: false }), '0', { writable: true })[0] threw exception TypeError: Cannot redefine property: 0.
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 1, writable:true }), '0', { value: 2 })[0] is 2
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 1 }), '0', { value: 1 })[0] is 1
PASS Object.defineProperty(Object.defineProperty([], '0', { value: Number.NaN }), '0', { value: -Number.NaN })[0] is Number.NaN
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 'okay'.substring(0,2) }), '0', { value: 'not ok'.substring(4,6) })[0] is "ok"
PASS Object.defineProperty(Object.defineProperty([], '0', { value: true }), '0', { value: true })[0] is true
PASS Object.defineProperty(Object.defineProperty([], '0', { value: false }), '0', { value: false })[0] is false
PASS Object.defineProperty(Object.defineProperty([], '0', { value: null }), '0', { value: null })[0] is null
PASS Object.defineProperty(Object.defineProperty([], '0', { value: undefined }), '0', { value: undefined })[0] is undefined
PASS Object.defineProperty(Object.defineProperty([], '0', { value: Math }), '0', { value: Math })[0] is Math
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 1 }), '0', { value: 2 })[0] threw exception TypeError: Cannot redefine property: 0.
PASS Object.defineProperty(Object.defineProperty([], '0', { value: 'okay' }), '0', { value: 'not ok' })[0] threw exception TypeError: Cannot redefine property: 0.
PASS Object.defineProperty(Object.defineProperty([], '0', { value: true }), '0', { value: false })[0] threw exception TypeError: Cannot redefine property: 0.
PASS Object.defineProperty(Object.defineProperty([], '0', { value: false }), '0', { value: true })[0] threw exception TypeError: Cannot redefine property: 0.
PASS Object.defineProperty(Object.defineProperty([], '0', { value: Math }), '0', { value: Object })[0] threw exception TypeError: Cannot redefine property: 0.
PASS Object.defineProperty(Object.defineProperty([], '0', { value: null }), '0', { value: undefined })[0] threw exception TypeError: Cannot redefine property: 0.
PASS Object.defineProperty(Object.defineProperty([], '0', { value: undefined }), '0', { value: null })[0] threw exception TypeError: Cannot redefine property: 0.
PASS arrObj[0] = 42; arrObj.set; is true
PASS arrObj[1] = true; arrObj[1]; is true
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,83 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("This test checks the behavior of [[DefineOwnProperty]] applied to Array objects (see ES5.1 15.4.5.1).");
// Test that properties other than length, array indices are handled as normal.
shouldBeTrue("Object.defineProperty([], 'x', { get:function(){return true;} }).x");
// The length property can be set, and can be made read-only.
shouldBe("Object.defineProperty([], 'length', { value: 1 }).length", '1');
shouldBe("var a = Object.defineProperty([], 'length', { writable: false }); a[1] = 1; a.length", '0');
shouldBe("var a = Object.defineProperty([], 'length', { writable: false }); a.length = 1; a.length", '0');
// If writable is not specified, it should not change.
shouldBe("var a = Object.defineProperty([], 'length', {}); a.length = 1; a.length", '1');
// The length property can be replaced with an accessor, or made either enumerable or configurable.
shouldThrow("Object.defineProperty([], 'length', { get:function(){return true;} })");
shouldThrow("Object.defineProperty([], 'length', { enumerable: true })");
shouldThrow("Object.defineProperty([], 'length', { configurable: true })");
shouldThrow("Object.defineProperty(Object.defineProperty([], 'length', { writable: false }), 'length', { writable: true })");
// The value of an indexed property can be set.
shouldBe("var a = Object.defineProperty([], '0', { value: 42 }); a[0]", '42');
// An indexed property can be made non-writable/enumerable/configurable.
shouldBe("var a = Object.defineProperty([42], '0', { writable: false }); a[0] = 1; a[0]", '42');
shouldBe("var a = Object.defineProperty([42], '0', { enumerable: false }); a[0] + Object.keys(a).length", '42');
shouldBe("var a = Object.defineProperty([42], '0', { configurable: false }); a.length = 0; a[0]", '42');
// An indexed property can be defined as an accessor.
shouldBe("var foo = 0; Object.defineProperty([], '0', { set:function(x){foo = x;} })[0] = 42; foo", '42');
shouldBeTrue("Object.defineProperty([], '0', { get:function(){return true;} })[0]")
// A configurable, non-writable property can be made writable, but a non-configurable one cannot.
shouldBeTrue("Object.defineProperty(Object.defineProperty([true], '0', { configurable:true, writable: false }), '0', { writable: true })[0]");
shouldThrow("Object.defineProperty(Object.defineProperty([true], '0', { configurable:false, writable: false }), '0', { writable: true })[0]");
// Reassigning the value is okay if the property is writable.
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: 1, writable:true }), '0', { value: 2 })[0]", '2');
// Reassigning the value is okay if the value doesn't change.
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: 1 }), '0', { value: 1 })[0]", '1');
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: Number.NaN }), '0', { value: -Number.NaN })[0]", 'Number.NaN');
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: 'okay'.substring(0,2) }), '0', { value: 'not ok'.substring(4,6) })[0]", '"ok"');
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: true }), '0', { value: true })[0]", 'true');
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: false }), '0', { value: false })[0]", 'false');
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: null }), '0', { value: null })[0]", 'null');
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: undefined }), '0', { value: undefined })[0]", 'undefined');
shouldBe("Object.defineProperty(Object.defineProperty([], '0', { value: Math }), '0', { value: Math })[0]", 'Math');
// Reassigning the value is not okay if the value changes.
shouldThrow("Object.defineProperty(Object.defineProperty([], '0', { value: 1 }), '0', { value: 2 })[0]");
shouldThrow("Object.defineProperty(Object.defineProperty([], '0', { value: 'okay' }), '0', { value: 'not ok' })[0]");
shouldThrow("Object.defineProperty(Object.defineProperty([], '0', { value: true }), '0', { value: false })[0]");
shouldThrow("Object.defineProperty(Object.defineProperty([], '0', { value: false }), '0', { value: true })[0]");
shouldThrow("Object.defineProperty(Object.defineProperty([], '0', { value: Math }), '0', { value: Object })[0]");
// Reassigning the value is not okay if the type changes.
shouldThrow("Object.defineProperty(Object.defineProperty([], '0', { value: null }), '0', { value: undefined })[0]");
shouldThrow("Object.defineProperty(Object.defineProperty([], '0', { value: undefined }), '0', { value: null })[0]");
Object.defineProperty(Array.prototype, "0", { set: function () { throw false; } });
Object.defineProperty(Array.prototype, "1", { set: function () { throw false; } });
var arrObj = [ , false ];
Object.defineProperty(arrObj, "0", { set: function (x) { this.set = x === 42; } });
shouldBeTrue("arrObj[0] = 42; arrObj.set;");
shouldBeTrue("arrObj[1] = true; arrObj[1];");
successfullyParsed = true;

View File

@ -0,0 +1,978 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks the behavior of the various array enumeration functions in certain edge case scenarios
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.every.call(toUnorderedObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.forEach.call(toUnorderedObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.some.call(toUnorderedObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.filter.call(toUnorderedObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduce.call(toUnorderedObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(simpleArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(emptyArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnIndex, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(largeSparseArray), forwarders[f], returnIndex, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.map.call(toUnorderedObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(simpleArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(emptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnFalse, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeSparseArray), forwarders[f], returnFalse, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(simpleArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(emptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnTrue, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeSparseArray), forwarders[f], returnTrue, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(simpleArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(emptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeEmptyArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnElem, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeSparseArray), forwarders[f], returnElem, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(simpleArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(emptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeEmptyArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], increaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeSparseArray), forwarders[f], increaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(simpleArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(emptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeEmptyArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], decreaseLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeSparseArray), forwarders[f], decreaseLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(simpleArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(emptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeEmptyArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], halveLength, 0) is count=0;lastIndex=-1;Array.prototype.reduceRight.call(toUnorderedObject(largeSparseArray), forwarders[f], halveLength, 0)
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnFalse, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnFalse, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnElem, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnElem, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], returnIndex, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], returnIndex, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], increaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], increaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], decreaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], decreaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(simpleArray).every(forwarders[f], halveLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(emptyArray).every(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).every(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).every(forwarders[f], halveLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.every.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], decreaseLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).forEach(forwarders[f], halveLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).forEach(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).forEach(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).forEach(forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.forEach.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnTrue, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnTrue, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 1
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 1
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnElem, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 2
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnElem, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 2
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], returnIndex, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 2
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], returnIndex, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 2
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 2
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], decreaseLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).some(forwarders[f], halveLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).some(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).some(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).some(forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.some.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], decreaseLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).filter(forwarders[f], halveLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).filter(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).filter(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).filter(forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.filter.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], decreaseLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduce(forwarders[f], halveLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduce(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduce(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduce(forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduce.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).map(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).map(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).map(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], returnIndex, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).map(forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], returnIndex, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], returnIndex, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).map(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], decreaseLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).map(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).map(forwarders[f], halveLength, 0); count is 3
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).map(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).map(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).map(forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.map.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnFalse, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnFalse, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnFalse, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnTrue, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnTrue, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnTrue, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], returnElem, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], returnElem, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], returnElem, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], increaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], increaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], increaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], decreaseLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], decreaseLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], decreaseLength, 0); count is 7
PASS count=0;lastIndex=-1;copyArray(simpleArray).reduceRight(forwarders[f], halveLength, 0); count is 4
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(simpleArray), forwarders[f], halveLength, 0); count is 6
PASS count=0;lastIndex=-1;copyArray(emptyArray).reduceRight(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(emptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeEmptyArray).reduceRight(forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeEmptyArray), forwarders[f], halveLength, 0); count is 0
PASS count=0;lastIndex=-1;copyArray(largeSparseArray).reduceRight(forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS count=0;lastIndex=-1;Array.prototype.reduceRight.call(toObject(largeSparseArray), forwarders[f], halveLength, 0); count is 7
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,145 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks the behavior of the various array enumeration functions in certain edge case scenarios"
);
var functions = ["every", "forEach", "some", "filter", "reduce", "map", "reduceRight"];
var forwarders = [
function(elem, index, array) { return currentFunc.call(this, elem, index, array); },
function(elem, index, array) { return currentFunc.call(this, elem, index, array); },
function(elem, index, array) { return currentFunc.call(this, elem, index, array); },
function(elem, index, array) { return currentFunc.call(this, elem, index, array); },
function(prev, elem, index, array) { return currentFunc.call(this, elem, index, array); },
function(elem, index, array) { return currentFunc.call(this, elem, index, array); },
function(prev, elem, index, array) { return currentFunc.call(this, elem, index, array); }
];
function toObject(array) {
var o = {};
for (var i in array)
o[i] = array[i];
o.length = array.length;
return o;
}
function toUnorderedObject(array) {
var o = {};
var props = [];
for (var i in array)
props.push(i);
for (var i = props.length - 1; i >= 0; i--)
o[props[i]] = array[props[i]];
o.length = array.length;
return o;
}
function returnFalse() { count++; return false; }
function returnTrue() { count++; return true; }
function returnElem(elem) { count++; return elem; }
function returnIndex(a, index) { if (lastIndex >= index) throw "Unordered traversal"; lastIndex = index; count++; return index; }
function increaseLength(a, b, array) { count++; array.length++; }
function decreaseLength(a, b, array) { count++; array.length--; }
function halveLength(a, b, array) { count++; if (!array.halved) array.length = (array.length / 2) | 0; array.halved = true; }
var testFunctions = ["returnFalse", "returnTrue", "returnElem", "returnIndex", "increaseLength", "decreaseLength", "halveLength"];
var simpleArray = [0,1,2,3,4,5];
var emptyArray = [];
var largeEmptyArray = new Array(300);
var largeSparseArray = [0,1,2,3,4,5];
largeSparseArray[299] = 299;
var arrays = ["simpleArray", "emptyArray", "largeEmptyArray", "largeSparseArray"];
function copyArray(a) {
var g = [];
for (var i in a)
g[i] = a[i];
return g;
}
// Test object and array behaviour matches
for (var f = 0; f < functions.length; f++) {
for (var t = 0; t < testFunctions.length; t++) {
for (var a = 0; a < arrays.length; a++) {
var functionName = functions[f];
currentFunc = this[testFunctions[t]];
if (arrays[a] === "largeEmptyArray" && functionName === "map")
continue;
if (currentFunc === returnIndex && functionName === "reduceRight")
continue;
shouldBe("count=0;lastIndex=-1;copyArray("+arrays[a]+")."+functionName+"(forwarders[f], "+testFunctions[t]+", 0)",
"count=0;lastIndex=-1;Array.prototype."+functionName+".call(toObject("+arrays[a]+"), forwarders[f], "+testFunctions[t]+", 0)");
}
}
}
// Test unordered object and array behaviour matches
for (var f = 0; f < functions.length; f++) {
for (var t = 0; t < testFunctions.length; t++) {
for (var a = 0; a < arrays.length; a++) {
var functionName = functions[f];
currentFunc = this[testFunctions[t]];
if (arrays[a] === "largeEmptyArray" && functionName === "map")
continue;
if (currentFunc === returnIndex && functionName === "reduceRight")
continue;
shouldBe("count=0;lastIndex=-1;copyArray("+arrays[a]+")."+functionName+"(forwarders[f], "+testFunctions[t]+", 0)",
"count=0;lastIndex=-1;Array.prototype."+functionName+".call(toUnorderedObject("+arrays[a]+"), forwarders[f], "+testFunctions[t]+", 0)");
}
}
}
// Test number of function calls
var callCounts = [
[[1,0,0,1],[6,0,0,7],[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[3,0,0,6],[3,0,0,6]],
[[6,0,0,7],[1,0,0,1],[2,0,0,2],[2,0,0,2],[6,0,0,7],[3,0,0,6],[3,0,0,6]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[3,0,0,6],[3,0,0,6]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[3,0,0,6],[3,0,0,6]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[3,0,0,6],[3,0,0,6]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[4,0,0,7]]
];
var objCallCounts = [
[[1,0,0,1],[6,0,0,7],[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7]],
[[6,0,0,7],[1,0,0,1],[2,0,0,2],[2,0,0,2],[6,0,0,7],[6,0,0,7],[6,0,0,7]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7]],
[[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7],[6,0,0,7]]
];
for (var f = 0; f < functions.length; f++) {
for (var t = 0; t < testFunctions.length; t++) {
for (var a = 0; a < arrays.length; a++) {
var functionName = functions[f];
currentFunc = this[testFunctions[t]];
if (currentFunc === returnIndex && functionName === "reduceRight")
continue;
var expectedCnt = "" + callCounts[f][t][a];
shouldBe("count=0;lastIndex=-1;copyArray("+arrays[a]+")."+functionName+"(forwarders[f], "+testFunctions[t]+", 0); count", expectedCnt);
var expectedCnt = "" + objCallCounts[f][t][a];
shouldBe("count=0;lastIndex=-1;Array.prototype."+functionName+".call(toObject("+arrays[a]+"), forwarders[f], "+testFunctions[t]+", 0); count", expectedCnt);
shouldBe("count=0;lastIndex=-1;Array.prototype."+functionName+".call(toObject("+arrays[a]+"), forwarders[f], "+testFunctions[t]+", 0); count", expectedCnt);
}
}
}

View File

@ -0,0 +1,75 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks the behavior of the every() method on Array objects.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
1.0 Single Argument Testing
PASS [12, 5, 8, 130, 44].every(isBigEnough) is false
PASS [12, 54, 18, 130, 44].every(isBigEnough) is true
2.0 Two Argument Testing
PASS [12, 5, 10, 130, 44].every(isBigEnough, predicate) is false
PASS [12, 54, 18, 130, 44].every(isBigEnough, predicate) is true
3.0 Array Mutation Tests
3.1 Array Element Removal
PASS [12, 5, 8, 130, 44].every(isBigEnoughAndPop) is false
PASS [12, 54, 18, 130, 44].every(isBigEnoughAndPop) is true
3.2 Array Element Changing
PASS [12, 5, 8, 130, 44].every(isBigEnoughAndChange) is false
PASS [12, 54, 18, 130, 44].every(isBigEnoughAndChange) is false
3.3 Array Element Addition
PASS [12, 5, 8, 130, 44].every(isBigEnoughAndPush) is false
PASS [12, 54, 18, 130, 44].every(isBigEnoughAndPush) is false
4.0 Exception Test
PASS [12, 5, 8, 130, 44].every(isBigEnoughAndException) threw exception exception from function.
PASS [12, 54, 18, 130, 44].every(isBigEnoughAndException) threw exception exception from function.
5.0 Wrong Type for Callback Test
PASS [12, 5, 8, 130, 44].every(5) threw exception TypeError: number 5 is not a function.
PASS [12, 5, 8, 130, 44].every('wrong') threw exception TypeError: string "wrong" is not a function.
PASS [12, 5, 8, 130, 44].every(new Object()) threw exception TypeError: object is not a function.
PASS [12, 5, 8, 130, 44].every(null) threw exception TypeError: object null is not a function.
PASS [12, 5, 8, 130, 44].every(undefined) threw exception TypeError: undefined is not a function.
PASS [12, 5, 8, 130, 44].every() threw exception TypeError: undefined is not a function.
6.0 Early Exit ("Short Circuiting")
PASS [12, 5, 8, 130, 44].every(isBigEnoughShortCircuit) is false
PASS accumulator.toString() is [12, 5].toString()
PASS [12, 54, 18, 130, 44].every(isBigEnoughShortCircuit) is true
PASS accumulator.toString() is [12, 54, 18, 130, 44].toString()
7.0 Behavior for Holes in Arrays
PASS arr.every(isNotUndefined) is true
PASS arr.every(isNotUndefined) is true
PASS successfullyParsed is true
TEST COMPLETE

116
deps/v8/test/webkit/array-every.js vendored Normal file
View File

@ -0,0 +1,116 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks the behavior of the every() method on Array objects."
);
debug("1.0 Single Argument Testing");
function isBigEnough(element, index, array) {
return (element >= 10);
}
shouldBeFalse("[12, 5, 8, 130, 44].every(isBigEnough)");
shouldBeTrue("[12, 54, 18, 130, 44].every(isBigEnough)");
debug("");
debug("2.0 Two Argument Testing");
var predicate = {
comparison: 11,
isBigEnough: function(s) {
return (s >= comparison);
}
};
shouldBeFalse("[12, 5, 10, 130, 44].every(isBigEnough, predicate)");
shouldBeTrue("[12, 54, 18, 130, 44].every(isBigEnough, predicate)");
debug("");
debug("3.0 Array Mutation Tests");
debug("");
debug("3.1 Array Element Removal");
function isBigEnoughAndPop(element, index, array) {
array.pop();
return (element >= 10);
}
shouldBeFalse("[12, 5, 8, 130, 44].every(isBigEnoughAndPop)");
shouldBeTrue("[12, 54, 18, 130, 44].every(isBigEnoughAndPop)");
debug("");
debug("3.2 Array Element Changing");
function isBigEnoughAndChange(element, index, array) {
array[array.length-1-index]= 5;
return (element >= 10);
}
shouldBeFalse("[12, 5, 8, 130, 44].every(isBigEnoughAndChange)");
shouldBeFalse("[12, 54, 18, 130, 44].every(isBigEnoughAndChange)");
debug("");
debug("3.3 Array Element Addition");
function isBigEnoughAndPush(element, index, array) {
array.push(131);
return (element >= 131);
}
shouldBeFalse("[12, 5, 8, 130, 44].every(isBigEnoughAndPush)");
shouldBeFalse("[12, 54, 18, 130, 44].every(isBigEnoughAndPush)");
debug("");
debug("4.0 Exception Test");
function isBigEnoughAndException(element, index, array) {
if(index==1) throw "exception from function";
return (element >= 10);
}
shouldThrow("[12, 5, 8, 130, 44].every(isBigEnoughAndException)", '"exception from function"');
shouldThrow("[12, 54, 18, 130, 44].every(isBigEnoughAndException)", '"exception from function"');
debug("");
debug("5.0 Wrong Type for Callback Test");
shouldThrow("[12, 5, 8, 130, 44].every(5)");
shouldThrow("[12, 5, 8, 130, 44].every('wrong')");
shouldThrow("[12, 5, 8, 130, 44].every(new Object())");
shouldThrow("[12, 5, 8, 130, 44].every(null)");
shouldThrow("[12, 5, 8, 130, 44].every(undefined)");
shouldThrow("[12, 5, 8, 130, 44].every()");
debug("");
debug('6.0 Early Exit ("Short Circuiting")');
var accumulator = new Array();
function isBigEnoughShortCircuit(element, index, array) {
accumulator.push(element);
return (element >= 10);
}
shouldBeFalse("[12, 5, 8, 130, 44].every(isBigEnoughShortCircuit)");
shouldBe("accumulator.toString()", "[12, 5].toString()");
accumulator.length = 0;
shouldBeTrue("[12, 54, 18, 130, 44].every(isBigEnoughShortCircuit)");
shouldBe("accumulator.toString()", "[12, 54, 18, 130, 44].toString()");
debug("");
debug('7.0 Behavior for Holes in Arrays');
var arr = [5, 5, 5, 5];
delete arr[1];
function isNotUndefined(element, index, array) {
return typeof element !== "undefined";
}
shouldBeTrue("arr.every(isNotUndefined)");
arr = new Array(20);
shouldBeTrue("arr.every(isNotUndefined)");

View File

@ -0,0 +1,90 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Tests for Array.prototype.filter
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS [undefined].filter(passUndefined) is [undefined]
PASS (new Array(20)).filter(passUndefined) is []
PASS [0,1,2,3,4,5,6,7,8,9].filter(passEven) is [0,2,4,6,8]
PASS [0,1,2,3,4,5,6,7,8,9].filter(passAfter5) is [5,6,7,8,9]
PASS mixPartialAndFast.filter(passAfter5) is [5,6,7,8,9,sparseArrayLength-1]
PASS toObject([undefined]).filter(passUndefined) is [undefined]
PASS toObject(new Array(20)).filter(passUndefined) is []
PASS toObject([0,1,2,3,4,5,6,7,8,9]).filter(passEven) is [0,2,4,6,8]
PASS toObject([0,1,2,3,4,5,6,7,8,9]).filter(passAfter5) is [5,6,7,8,9]
PASS toObject(mixPartialAndFast).filter(passAfter5) is [5,6,7,8,9,sparseArrayLength-1]
PASS reverseInsertionOrder([undefined]).filter(passUndefined) is [undefined]
PASS reverseInsertionOrder(new Array(20)).filter(passUndefined) is []
PASS reverseInsertionOrder([0,1,2,3,4,5,6,7,8,9]).filter(passEven) is [0,2,4,6,8]
PASS reverseInsertionOrder([0,1,2,3,4,5,6,7,8,9]).filter(passAfter5) is [5,6,7,8,9]
PASS reverseInsertionOrder(mixPartialAndFast).filter(passAfter5) is [5,6,7,8,9,sparseArrayLength-1]
,0,[object Object]
PASS reverseInsertionOrder([undefined]).filter(filterLog(passUndefined)) is [undefined]
PASS reverseInsertionOrder(new Array(20)).filter(filterLog(passUndefined)) is []
0,0,[object Object]
1,1,[object Object]
2,2,[object Object]
3,3,[object Object]
4,4,[object Object]
PASS reverseInsertionOrder([0,1,2,3,4]).filter(filterLog(passEven)) is [0,2,4]
0,0,[object Object]
1,1,[object Object]
2,2,[object Object]
3,3,[object Object]
4,4,[object Object]
5,5,[object Object]
6,6,[object Object]
7,7,[object Object]
8,8,[object Object]
9,9,[object Object]
10099,10099,[object Object]
PASS reverseInsertionOrder(mixPartialAndFast).filter(filterLog(passAfter5)) is [5,6,7,8,9,sparseArrayLength-1]
,0,
PASS ([undefined]).filter(filterLog(passUndefined)) is [undefined]
PASS (new Array(20)).filter(filterLog(passUndefined)) is []
0,0,0,1,2,3,4
1,1,0,1,2,3,4
2,2,0,1,2,3,4
3,3,0,1,2,3,4
4,4,0,1,2,3,4
PASS ([0,1,2,3,4]).filter(filterLog(passEven)) is [0,2,4]
0,0,0,1,2,3,4,5,6,7,8,9,
1,1,0,1,2,3,4,5,6,7,8,9,
2,2,0,1,2,3,4,5,6,7,8,9,
3,3,0,1,2,3,4,5,6,7,8,9,
4,4,0,1,2,3,4,5,6,7,8,9,
5,5,0,1,2,3,4,5,6,7,8,9,
6,6,0,1,2,3,4,5,6,7,8,9,
7,7,0,1,2,3,4,5,6,7,8,9,
8,8,0,1,2,3,4,5,6,7,8,9,
9,9,0,1,2,3,4,5,6,7,8,9,
10099,10099,0,1,2,3,4,5,6,7,8,9,
PASS (mixPartialAndFast).filter(filterLog(passAfter5)) is [5,6,7,8,9,sparseArrayLength-1]
PASS [1,2,3].filter(function(i,j,k,l,m){ return m=!m; }) is [1,2,3]
PASS successfullyParsed is true
TEST COMPLETE

100
deps/v8/test/webkit/array-filter.js vendored Normal file
View File

@ -0,0 +1,100 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Tests for Array.prototype.filter");
function passUndefined(element, index, array) {
return typeof element === "undefined";
}
function passEven(a) {
return !(a & 1);
}
function passAfter5(element, index) {
return index >= 5;
}
var sparseArrayLength = 10100;
mixPartialAndFast = new Array(sparseArrayLength);
mixPartialAndFast[sparseArrayLength - 1] = sparseArrayLength - 1;
for(var i = 0; i < 10; i++)
mixPartialAndFast[i] = i;
function toObject(array) {
var result = {};
result.length = array.length;
for (var i in array)
result[i] = array[i];
result.filter=Array.prototype.filter;
return result;
}
function reverseInsertionOrder(array) {
var obj = toObject(array);
var props = [];
for (var i in obj)
props.push(i);
var result = {};
for (var i = props.length - 1; i >= 0; i--)
result[props[i]] = obj[props[i]];
result.filter=Array.prototype.filter;
return result;
}
function filterLog(f) {
return function(i,j) {
try {
debug([i,j,arguments[2].toString().substring(0,20)].toString());
return f.apply(this, arguments);
} catch(e) {
console.error(e);
}
}
}
shouldBe("[undefined].filter(passUndefined)", "[undefined]");
shouldBe("(new Array(20)).filter(passUndefined)", "[]");
shouldBe("[0,1,2,3,4,5,6,7,8,9].filter(passEven)", "[0,2,4,6,8]");
shouldBe("[0,1,2,3,4,5,6,7,8,9].filter(passAfter5)", "[5,6,7,8,9]");
shouldBe("mixPartialAndFast.filter(passAfter5)", "[5,6,7,8,9,sparseArrayLength-1]");
// Generic Object
shouldBe("toObject([undefined]).filter(passUndefined)", "[undefined]");
shouldBe("toObject(new Array(20)).filter(passUndefined)", "[]");
shouldBe("toObject([0,1,2,3,4,5,6,7,8,9]).filter(passEven)", "[0,2,4,6,8]");
shouldBe("toObject([0,1,2,3,4,5,6,7,8,9]).filter(passAfter5)", "[5,6,7,8,9]");
shouldBe("toObject(mixPartialAndFast).filter(passAfter5)", "[5,6,7,8,9,sparseArrayLength-1]");
// Reversed generic Object
shouldBe("reverseInsertionOrder([undefined]).filter(passUndefined)", "[undefined]");
shouldBe("reverseInsertionOrder(new Array(20)).filter(passUndefined)", "[]");
shouldBe("reverseInsertionOrder([0,1,2,3,4,5,6,7,8,9]).filter(passEven)", "[0,2,4,6,8]");
shouldBe("reverseInsertionOrder([0,1,2,3,4,5,6,7,8,9]).filter(passAfter5)", "[5,6,7,8,9]");
shouldBe("reverseInsertionOrder(mixPartialAndFast).filter(passAfter5)", "[5,6,7,8,9,sparseArrayLength-1]");
// Log evaluation order
shouldBe("reverseInsertionOrder([undefined]).filter(filterLog(passUndefined))", "[undefined]");
shouldBe("reverseInsertionOrder(new Array(20)).filter(filterLog(passUndefined))", "[]");
shouldBe("reverseInsertionOrder([0,1,2,3,4]).filter(filterLog(passEven))", "[0,2,4]");
shouldBe("reverseInsertionOrder(mixPartialAndFast).filter(filterLog(passAfter5))", "[5,6,7,8,9,sparseArrayLength-1]");
shouldBe("([undefined]).filter(filterLog(passUndefined))", "[undefined]");
shouldBe("(new Array(20)).filter(filterLog(passUndefined))", "[]");
shouldBe("([0,1,2,3,4]).filter(filterLog(passEven))", "[0,2,4]");
shouldBe("(mixPartialAndFast).filter(filterLog(passAfter5))", "[5,6,7,8,9,sparseArrayLength-1]");
shouldBe("[1,2,3].filter(function(i,j,k,l,m){ return m=!m; })", "[1,2,3]")

View File

@ -0,0 +1,85 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that arrays have holes that you can see the prototype through, not just missing values.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS var a = []; a.length = 1; showHoles(a) is '[hole]'
PASS var a = []; a[0] = undefined; showHoles(a) is '[undefined]'
PASS var a = []; a[0] = undefined; delete a[0]; showHoles(a) is '[hole]'
PASS showHoles([0, , 2]) is '[0, hole, 2]'
PASS showHoles([0, 1, ,]) is '[0, 1, hole]'
PASS showHoles([0, , 2].concat([3, , 5])) is '[0, hole, 2, 3, hole, 5]'
PASS showHoles([0, , 2, 3].reverse()) is '[3, 2, hole, 0]'
PASS a = [0, , 2, 3]; a.shift(); showHoles(a) is '[hole, 2, 3]'
PASS showHoles([0, , 2, 3].slice(0, 3)) is '[0, hole, 2]'
PASS showHoles([0, , 2, 3].sort()) is '[0, 2, 3, hole]'
PASS showHoles([0, undefined, 2, 3].sort()) is '[0, 2, 3, undefined]'
PASS a = [0, , 2, 3]; a.splice(2, 3, 5, 6); showHoles(a) is '[0, hole, 5, 6]'
PASS a = [0, , 2, 3]; a.unshift(4); showHoles(a) is '[4, 0, hole, 2, 3]'
PASS showHoles([0, , 2, 3].filter(returnTrue)) is '[0, 2, 3]'
PASS showHoles([0, undefined, 2, 3].filter(returnTrue)) is '[0, undefined, 2, 3]'
PASS showHoles([0, , 2, 3].map(returnTrue)) is '[true, hole, true, true]'
PASS showHoles([0, undefined, 2, 3].map(returnTrue)) is '[true, true, true, true]'
PASS a = []; [0, , 2, 3].every(addToArrayReturnTrue); showHoles(a) is '[0, 2, 3]'
PASS a = []; [0, undefined, 2, 3].every(addToArrayReturnTrue); showHoles(a) is '[0, undefined, 2, 3]'
PASS a = []; [0, , 2, 3].forEach(addToArray); showHoles(a) is '[0, 2, 3]'
PASS a = []; [0, undefined, 2, 3].forEach(addToArray); showHoles(a) is '[0, undefined, 2, 3]'
PASS a = []; [0, , 2, 3].some(addToArrayReturnFalse); showHoles(a) is '[0, 2, 3]'
PASS a = []; [0, undefined, 2, 3].some(addToArrayReturnFalse); showHoles(a) is '[0, undefined, 2, 3]'
PASS [0, , 2, 3].indexOf() is -1
PASS [0, undefined, 2, 3].indexOf() is 1
PASS [0, , 2, 3].lastIndexOf() is -1
PASS [0, undefined, 2, 3].lastIndexOf() is 1
PASS showHoles([0, , 2]) is '[0, hole, 2]'
PASS showHoles([0, 1, ,]) is '[0, 1, hole]'
PASS showHoles([0, , 2].concat([3, , 5])) is '[0, peekaboo, 2, 3, peekaboo, 5]'
PASS showHoles([0, , 2, 3].reverse()) is '[3, 2, peekaboo, 0]'
PASS a = [0, , 2, 3]; a.shift(); showHoles(a) is '[peekaboo, 2, 3]'
PASS showHoles([0, , 2, 3].slice(0, 3)) is '[0, peekaboo, 2]'
PASS showHoles([0, , 2, 3].sort()) is '[0, 2, 3, peekaboo]'
PASS showHoles([0, undefined, 2, 3].sort()) is '[0, 2, 3, undefined]'
PASS a = [0, , 2, 3]; a.splice(2, 3, 5, 6); showHoles(a) is '[0, hole, 5, 6]'
PASS a = [0, , 2, 3]; a.unshift(4); showHoles(a) is '[4, 0, peekaboo, 2, 3]'
PASS showHoles([0, , 2, 3].filter(returnTrue)) is '[0, peekaboo, 2, 3]'
PASS showHoles([0, undefined, 2, 3].filter(returnTrue)) is '[0, undefined, 2, 3]'
PASS showHoles([0, , 2, 3].map(returnTrue)) is '[true, true, true, true]'
PASS showHoles([0, undefined, 2, 3].map(returnTrue)) is '[true, true, true, true]'
PASS a = []; [0, , 2, 3].every(addToArrayReturnTrue); showHoles(a) is '[0, peekaboo, 2, 3]'
PASS a = []; [0, undefined, 2, 3].every(addToArrayReturnTrue); showHoles(a) is '[0, undefined, 2, 3]'
PASS a = []; [0, , 2, 3].forEach(addToArray); showHoles(a) is '[0, peekaboo, 2, 3]'
PASS a = []; [0, undefined, 2, 3].forEach(addToArray); showHoles(a) is '[0, undefined, 2, 3]'
PASS a = []; [0, , 2, 3].some(addToArrayReturnFalse); showHoles(a) is '[0, peekaboo, 2, 3]'
PASS a = []; [0, undefined, 2, 3].some(addToArrayReturnFalse); showHoles(a) is '[0, undefined, 2, 3]'
PASS [0, , 2, 3].indexOf() is -1
PASS [0, , 2, 3].indexOf('peekaboo') is 1
PASS [0, undefined, 2, 3].indexOf() is 1
PASS [0, , 2, 3].lastIndexOf() is -1
PASS [0, , 2, 3].lastIndexOf('peekaboo') is 1
PASS [0, undefined, 2, 3].lastIndexOf() is 1
PASS successfullyParsed is true
TEST COMPLETE

134
deps/v8/test/webkit/array-holes.js vendored Normal file
View File

@ -0,0 +1,134 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("This tests that arrays have holes that you can see the prototype through, not just missing values.");
function isHole(array, index)
{
if (index >= array.length)
return "bad index: past length";
// Check if we can see through the hole into another room.
Array.prototype[index] = "room";
var isHole = array[index] == "room";
delete Array.prototype[index];
return isHole;
}
function showHoles(array)
{
var string = "[";
for (i = 0; i < array.length; ++i) {
if (i)
string += ", ";
if (isHole(array, i))
string += "hole";
else
string += array[i];
}
string += "]";
return string;
}
function returnTrue()
{
return true;
}
var a;
function addToArray(arg)
{
a.push(arg);
}
function addToArrayReturnFalse(arg)
{
a.push(arg);
return false;
}
function addToArrayReturnTrue(arg)
{
a.push(arg);
return true;
}
shouldBe("var a = []; a.length = 1; showHoles(a)", "'[hole]'");
shouldBe("var a = []; a[0] = undefined; showHoles(a)", "'[undefined]'");
shouldBe("var a = []; a[0] = undefined; delete a[0]; showHoles(a)", "'[hole]'");
shouldBe("showHoles([0, , 2])", "'[0, hole, 2]'");
shouldBe("showHoles([0, 1, ,])", "'[0, 1, hole]'");
shouldBe("showHoles([0, , 2].concat([3, , 5]))", "'[0, hole, 2, 3, hole, 5]'");
shouldBe("showHoles([0, , 2, 3].reverse())", "'[3, 2, hole, 0]'");
shouldBe("a = [0, , 2, 3]; a.shift(); showHoles(a)", "'[hole, 2, 3]'");
shouldBe("showHoles([0, , 2, 3].slice(0, 3))", "'[0, hole, 2]'");
shouldBe("showHoles([0, , 2, 3].sort())", "'[0, 2, 3, hole]'");
shouldBe("showHoles([0, undefined, 2, 3].sort())", "'[0, 2, 3, undefined]'");
shouldBe("a = [0, , 2, 3]; a.splice(2, 3, 5, 6); showHoles(a)", "'[0, hole, 5, 6]'");
shouldBe("a = [0, , 2, 3]; a.unshift(4); showHoles(a)", "'[4, 0, hole, 2, 3]'");
shouldBe("showHoles([0, , 2, 3].filter(returnTrue))", "'[0, 2, 3]'");
shouldBe("showHoles([0, undefined, 2, 3].filter(returnTrue))", "'[0, undefined, 2, 3]'");
shouldBe("showHoles([0, , 2, 3].map(returnTrue))", "'[true, hole, true, true]'");
shouldBe("showHoles([0, undefined, 2, 3].map(returnTrue))", "'[true, true, true, true]'");
shouldBe("a = []; [0, , 2, 3].every(addToArrayReturnTrue); showHoles(a)", "'[0, 2, 3]'");
shouldBe("a = []; [0, undefined, 2, 3].every(addToArrayReturnTrue); showHoles(a)", "'[0, undefined, 2, 3]'");
shouldBe("a = []; [0, , 2, 3].forEach(addToArray); showHoles(a)", "'[0, 2, 3]'");
shouldBe("a = []; [0, undefined, 2, 3].forEach(addToArray); showHoles(a)", "'[0, undefined, 2, 3]'");
shouldBe("a = []; [0, , 2, 3].some(addToArrayReturnFalse); showHoles(a)", "'[0, 2, 3]'");
shouldBe("a = []; [0, undefined, 2, 3].some(addToArrayReturnFalse); showHoles(a)", "'[0, undefined, 2, 3]'");
shouldBe("[0, , 2, 3].indexOf()", "-1");
shouldBe("[0, undefined, 2, 3].indexOf()", "1");
shouldBe("[0, , 2, 3].lastIndexOf()", "-1");
shouldBe("[0, undefined, 2, 3].lastIndexOf()", "1");
Object.prototype[1] = "peekaboo";
shouldBe("showHoles([0, , 2])", "'[0, hole, 2]'");
shouldBe("showHoles([0, 1, ,])", "'[0, 1, hole]'");
shouldBe("showHoles([0, , 2].concat([3, , 5]))", "'[0, peekaboo, 2, 3, peekaboo, 5]'");
shouldBe("showHoles([0, , 2, 3].reverse())", "'[3, 2, peekaboo, 0]'");
shouldBe("a = [0, , 2, 3]; a.shift(); showHoles(a)", "'[peekaboo, 2, 3]'");
shouldBe("showHoles([0, , 2, 3].slice(0, 3))", "'[0, peekaboo, 2]'");
shouldBe("showHoles([0, , 2, 3].sort())", "'[0, 2, 3, peekaboo]'");
shouldBe("showHoles([0, undefined, 2, 3].sort())", "'[0, 2, 3, undefined]'");
shouldBe("a = [0, , 2, 3]; a.splice(2, 3, 5, 6); showHoles(a)", "'[0, hole, 5, 6]'");
shouldBe("a = [0, , 2, 3]; a.unshift(4); showHoles(a)", "'[4, 0, peekaboo, 2, 3]'");
shouldBe("showHoles([0, , 2, 3].filter(returnTrue))", "'[0, peekaboo, 2, 3]'");
shouldBe("showHoles([0, undefined, 2, 3].filter(returnTrue))", "'[0, undefined, 2, 3]'");
shouldBe("showHoles([0, , 2, 3].map(returnTrue))", "'[true, true, true, true]'");
shouldBe("showHoles([0, undefined, 2, 3].map(returnTrue))", "'[true, true, true, true]'");
shouldBe("a = []; [0, , 2, 3].every(addToArrayReturnTrue); showHoles(a)", "'[0, peekaboo, 2, 3]'");
shouldBe("a = []; [0, undefined, 2, 3].every(addToArrayReturnTrue); showHoles(a)", "'[0, undefined, 2, 3]'");
shouldBe("a = []; [0, , 2, 3].forEach(addToArray); showHoles(a)", "'[0, peekaboo, 2, 3]'");
shouldBe("a = []; [0, undefined, 2, 3].forEach(addToArray); showHoles(a)", "'[0, undefined, 2, 3]'");
shouldBe("a = []; [0, , 2, 3].some(addToArrayReturnFalse); showHoles(a)", "'[0, peekaboo, 2, 3]'");
shouldBe("a = []; [0, undefined, 2, 3].some(addToArrayReturnFalse); showHoles(a)", "'[0, undefined, 2, 3]'");
shouldBe("[0, , 2, 3].indexOf()", "-1");
shouldBe("[0, , 2, 3].indexOf('peekaboo')", "1");
shouldBe("[0, undefined, 2, 3].indexOf()", "1");
shouldBe("[0, , 2, 3].lastIndexOf()", "-1");
shouldBe("[0, , 2, 3].lastIndexOf('peekaboo')", "1");
shouldBe("[0, undefined, 2, 3].lastIndexOf()", "1");
delete Object.prototype[1];

View File

@ -0,0 +1,39 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks the behaviour of indexing an Array with immediate types.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS array[0] is "Zero"
PASS array[null] is undefined
PASS array[undefined] is undefined
PASS array[true] is undefined
PASS array[false] is undefined
PASS putSelf([0], 0); is true
PASS putSelf([0], 1/9); is true
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,44 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks the behaviour of indexing an Array with immediate types."
);
var array = ["Zero", "One"];
shouldBe("array[0]", '"Zero"');
shouldBe("array[null]", "undefined");
shouldBe("array[undefined]", "undefined");
shouldBe("array[true]", "undefined");
shouldBe("array[false]", "undefined");
function putSelf(array, index)
{
index = index << 0;
array[index] = index;
return true;
}
shouldBeTrue("putSelf([0], 0);");
shouldBeTrue("putSelf([0], 1/9);");

View File

@ -0,0 +1,35 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks that array accessing doesn't do the wrong thing for negative indices
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS a.length is 0
PASS a["-5"] is a[-5]
PASS a[4] is undefined
PASS successfullyParsed is true
TEST COMPLETE

37
deps/v8/test/webkit/array-indexing.js vendored Normal file
View File

@ -0,0 +1,37 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks that array accessing doesn't do the wrong thing for negative indices"
);
var a = [];
a[-5] = true;
shouldBe('a.length', '0');
shouldBe('a["-5"]', 'a[-5]');
// Just some bounds paranoia
a = [1,2,3,4];
shouldBe('a[4]', 'undefined');
a = [];
for (var i = 0; i > -1000; i--) a[i] = i;

View File

@ -0,0 +1,35 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks that iterating a large array backwards works correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS verify(32768) is true
PASS verify(65536) is true
PASS verify(120000) is true
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,55 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks that iterating a large array backwards works correctly."
);
var bytes = new Array();
function prepare(nbytes) {
var i = nbytes - 1;
while (i >= 0) {
bytes[i] = new Number(i);
i -= 1;
}
}
function verify(nbytes) {
var i = nbytes - 1;
while (i >= 0) {
if (bytes[i] != i)
return false;
i -= 1;
}
return true;
}
prepare(32768);
shouldBeTrue('verify(32768)');
prepare(65536);
shouldBeTrue('verify(65536)');
prepare(120000);
shouldBeTrue('verify(120000)');

View File

@ -0,0 +1,46 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks lastIndexOf for various values in an array
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS lastIndex is -1
PASS lastIndex is 2
PASS lastIndex is 3
PASS lastIndex is -1
PASS lastIndex is 3
PASS lastIndex is 0
PASS lastIndex is 0
PASS lastIndex is 3
PASS lastIndex is -1
PASS lastIndex is -1
PASS lastIndex is -1
PASS lastIndex is 19
PASS lastIndex is -1
PASS lastIndex is -1
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,75 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
'This test checks lastIndexOf for various values in an array'
);
var testArray = [2, 5, 9, 2];
var lastIndex = 0;
lastIndex = testArray.lastIndexOf(2,-500);
shouldBe('lastIndex', '-1');
lastIndex = testArray.lastIndexOf(9,500);
shouldBe('lastIndex', '2');
lastIndex = testArray.lastIndexOf(2);
shouldBe('lastIndex', '3');
lastIndex = testArray.lastIndexOf(7);
shouldBe('lastIndex', '-1');
lastIndex = testArray.lastIndexOf(2, 3);
shouldBe('lastIndex', '3');
lastIndex = testArray.lastIndexOf(2, 2);
shouldBe('lastIndex', '0');
lastIndex = testArray.lastIndexOf(2, -2);
shouldBe('lastIndex', '0');
lastIndex = testArray.lastIndexOf(2, -1);
shouldBe('lastIndex', '3');
delete testArray[1];
lastIndex = testArray.lastIndexOf(undefined);
shouldBe('lastIndex', '-1');
delete testArray[3];
lastIndex = testArray.lastIndexOf(undefined);
shouldBe('lastIndex', '-1');
testArray = new Array(20);
lastIndex = testArray.lastIndexOf(undefined);
shouldBe('lastIndex', '-1');
testArray[19] = undefined;
lastIndex = testArray.lastIndexOf(undefined);
shouldBe('lastIndex', '19');
lastIndex = testArray.lastIndexOf(undefined, 18);
shouldBe('lastIndex', '-1');
delete testArray[19];
lastIndex = testArray.lastIndexOf(undefined);
shouldBe('lastIndex', '-1');

View File

@ -0,0 +1,50 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks that functions on the array prototype correctly handle exceptions from length getters when called on non-array objects.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS test(Array.prototype.join) is true
PASS test(Array.prototype.pop) is true
PASS test(Array.prototype.push) is true
PASS test(Array.prototype.reverse) is true
PASS test(Array.prototype.shift) is true
PASS test(Array.prototype.slice) is true
PASS test(Array.prototype.sort) is true
PASS test(Array.prototype.splice) is true
PASS test(Array.prototype.unshift) is true
PASS test(Array.prototype.indexOf) is true
PASS test(Array.prototype.lastIndexOf) is true
PASS test(Array.prototype.every) is true
PASS test(Array.prototype.some) is true
PASS test(Array.prototype.forEach) is true
PASS test(Array.prototype.map) is true
PASS test(Array.prototype.filter) is true
PASS test(Array.prototype.reduce) is true
PASS test(Array.prototype.reduceRight) is true
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,64 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks that functions on the array prototype correctly handle exceptions from length getters when called on non-array objects."
);
var testObj = {
0: "a",
1: "b",
2: "c"
};
var lengthGetter = {
get: (function() { throw true; })
}
Object.defineProperty(testObj, "length", lengthGetter);
function test(f) {
try {
f.call(testObj, undefined);
return false;
} catch (e) {
return e === true;
}
}
shouldBeTrue("test(Array.prototype.join)");
shouldBeTrue("test(Array.prototype.pop)");
shouldBeTrue("test(Array.prototype.push)");
shouldBeTrue("test(Array.prototype.reverse)");
shouldBeTrue("test(Array.prototype.shift)");
shouldBeTrue("test(Array.prototype.slice)");
shouldBeTrue("test(Array.prototype.sort)");
shouldBeTrue("test(Array.prototype.splice)");
shouldBeTrue("test(Array.prototype.unshift)");
shouldBeTrue("test(Array.prototype.indexOf)");
shouldBeTrue("test(Array.prototype.lastIndexOf)");
shouldBeTrue("test(Array.prototype.every)");
shouldBeTrue("test(Array.prototype.some)");
shouldBeTrue("test(Array.prototype.forEach)");
shouldBeTrue("test(Array.prototype.map)");
shouldBeTrue("test(Array.prototype.filter)");
shouldBeTrue("test(Array.prototype.reduce)");
shouldBeTrue("test(Array.prototype.reduceRight)");

View File

@ -0,0 +1,50 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks that functions on the array prototype correctly handle exceptions from property getters when called on non-array objects.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS test(Array.prototype.sort) is true
PASS test(Array.prototype.every) is true
PASS test(Array.prototype.some) is true
PASS test(Array.prototype.forEach) is true
PASS test(Array.prototype.map) is true
PASS test(Array.prototype.filter) is true
PASS test(Array.prototype.reduce) is true
PASS test(Array.prototype.reduceRight) is true
PASS test(Array.prototype.join) is true
PASS test(Array.prototype.pop) is true
PASS test(Array.prototype.push) is false
PASS test(Array.prototype.reverse) is true
PASS test(Array.prototype.shift) is true
PASS test(Array.prototype.slice) is true
PASS test(Array.prototype.splice) is true
PASS test(Array.prototype.unshift) is true
PASS test(Array.prototype.indexOf) is true
PASS test(Array.prototype.lastIndexOf) is true
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,68 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks that functions on the array prototype correctly handle exceptions from property getters when called on non-array objects."
);
function test(f) {
var testObj = {
length: 3
};
var propertyGetter = {
get: (function() { throw true; })
}
Object.defineProperty(testObj, 0, propertyGetter);
Object.defineProperty(testObj, 1, propertyGetter);
Object.defineProperty(testObj, 2, propertyGetter);
try {
f.call(testObj, function(){});
return false;
} catch (e) {
return e === true;
}
}
// This test makes sense for these functions: (they should get all properties on the array)
shouldBeTrue("test(Array.prototype.sort)");
shouldBeTrue("test(Array.prototype.every)");
shouldBeTrue("test(Array.prototype.some)");
shouldBeTrue("test(Array.prototype.forEach)");
shouldBeTrue("test(Array.prototype.map)");
shouldBeTrue("test(Array.prototype.filter)");
shouldBeTrue("test(Array.prototype.reduce)");
shouldBeTrue("test(Array.prototype.reduceRight)");
// Probably not testing much of anything in these cases, but make sure they don't crash!
shouldBeTrue("test(Array.prototype.join)");
shouldBeTrue("test(Array.prototype.pop)");
shouldBeFalse("test(Array.prototype.push)");
shouldBeTrue("test(Array.prototype.reverse)");
shouldBeTrue("test(Array.prototype.shift)");
shouldBeTrue("test(Array.prototype.slice)");
shouldBeTrue("test(Array.prototype.splice)");
shouldBeTrue("test(Array.prototype.unshift)");
shouldBeTrue("test(Array.prototype.indexOf)");
shouldBeTrue("test(Array.prototype.lastIndexOf)");

View File

@ -0,0 +1,63 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks the behavior of the reduce() method on a number of objects.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS [0,1,2,3].reduce(function(a,b){ return a + b; }) is 6
PASS [1,2,3].reduce(function(a,b){ return a + b; }) is 6
PASS [0,1,2,3].reduce(function(a,b){ return a + b; }, 4) is 10
PASS [1,2,3].reduce(function(a,b){ return a + b; }, 4) is 10
PASS toObject([0,1,2,3]).reduce(function(a,b){ return a + b; }) is 6
PASS toObject([1,2,3]).reduce(function(a,b){ return a + b; }) is 6
PASS toObject([0,1,2,3]).reduce(function(a,b){ return a + b; }, 4) is 10
PASS toObject([1,2,3]).reduce(function(a,b){ return a + b; }, 4) is 10
PASS toUnorderedObject([0,1,2,3]).reduce(function(a,b){ return a + b; }) is 6
PASS toUnorderedObject([1,2,3]).reduce(function(a,b){ return a + b; }) is 6
PASS toUnorderedObject([0,1,2,3]).reduce(function(a,b){ return a + b; }, 4) is 10
PASS toUnorderedObject([1,2,3]).reduce(function(a,b){ return a + b; }, 4) is 10
PASS sparseArray.reduce(function(a,b){ return a + b; }, 0) is 10
PASS toObject(sparseArray).reduce(function(a,b){ return a + b; }, 0) is 10
PASS sparseArray.reduce(function(a,b){ callCount++; }); callCount is 0
PASS toObject(sparseArray).reduce(function(a,b){ callCount++; }); callCount is 0
PASS sparseArray.reduce(function(a,b){ callCount++; }, 0); callCount is 1
PASS toObject(sparseArray).reduce(function(a,b){ callCount++; }, 0); callCount is 1
PASS [0,1,2,3,4].reduce(function(a,b){ callCount++; }, 0); callCount is 5
PASS [0,1,2,3,4].reduce(function(a,b){ callCount++; }); callCount is 4
PASS [1, 2, 3, 4].reduce(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount is 2
PASS [1, 2, 3, 4].reduce(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount is 4
PASS toObject([1, 2, 3, 4]).reduce(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount is 4
PASS toObject([1, 2, 3, 4]).reduce(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount is 4
PASS [[0,1], [2,3], [4,5]].reduce(function(a,b) {return a.concat(b);}, []) is [0,1,2,3,4,5]
PASS toObject([[0,1], [2,3], [4,5]]).reduce(function(a,b) {return a.concat(b);}, []) is [0,1,2,3,4,5]
PASS toObject([0,1,2,3,4,5]).reduce(function(a,b,i) {return a.concat([i,b]);}, []) is [0,0,1,1,2,2,3,3,4,4,5,5]
PASS toUnorderedObject([[0,1], [2,3], [4,5]]).reduce(function(a,b) {return a.concat(b);}, []) is [0,1,2,3,4,5]
PASS toUnorderedObject([0,1,2,3,4,5]).reduce(function(a,b,i) {return a.concat([i,b]);}, []) is [0,0,1,1,2,2,3,3,4,4,5,5]
PASS [0,1,2,3,4,5].reduce(function(a,b,i) {return a.concat([i,b]);}, []) is [0,0,1,1,2,2,3,3,4,4,5,5]
PASS [2,3].reduce(function() {'use strict'; return this;}) is undefined
PASS successfullyParsed is true
TEST COMPLETE

91
deps/v8/test/webkit/array-reduce.js vendored Normal file
View File

@ -0,0 +1,91 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks the behavior of the reduce() method on a number of objects."
);
function toObject(array) {
var o = {};
for (var i in array)
o[i] = array[i];
o.length = array.length;
o.reduce = Array.prototype.reduce;
return o;
}
function toUnorderedObject(array) {
var o = {};
var props = [];
for (var i in array)
props.push(i);
for (var i = props.length - 1; i >= 0; i--)
o[props[i]] = array[props[i]];
o.length = array.length;
o.reduce = Array.prototype.reduce;
return o;
}
shouldBe("[0,1,2,3].reduce(function(a,b){ return a + b; })", "6");
shouldBe("[1,2,3].reduce(function(a,b){ return a + b; })", "6");
shouldBe("[0,1,2,3].reduce(function(a,b){ return a + b; }, 4)", "10");
shouldBe("[1,2,3].reduce(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toObject([0,1,2,3]).reduce(function(a,b){ return a + b; })", "6");
shouldBe("toObject([1,2,3]).reduce(function(a,b){ return a + b; })", "6");
shouldBe("toObject([0,1,2,3]).reduce(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toObject([1,2,3]).reduce(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toUnorderedObject([0,1,2,3]).reduce(function(a,b){ return a + b; })", "6");
shouldBe("toUnorderedObject([1,2,3]).reduce(function(a,b){ return a + b; })", "6");
shouldBe("toUnorderedObject([0,1,2,3]).reduce(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toUnorderedObject([1,2,3]).reduce(function(a,b){ return a + b; }, 4)", "10");
sparseArray = [];
sparseArray[10] = 10;
shouldBe("sparseArray.reduce(function(a,b){ return a + b; }, 0)", "10");
shouldBe("toObject(sparseArray).reduce(function(a,b){ return a + b; }, 0)", "10");
var callCount = 0;
shouldBe("sparseArray.reduce(function(a,b){ callCount++; }); callCount", "0");
callCount = 0;
shouldBe("toObject(sparseArray).reduce(function(a,b){ callCount++; }); callCount", "0");
var callCount = 0;
shouldBe("sparseArray.reduce(function(a,b){ callCount++; }, 0); callCount", "1");
callCount = 0;
shouldBe("toObject(sparseArray).reduce(function(a,b){ callCount++; }, 0); callCount", "1");
callCount = 0;
shouldBe("[0,1,2,3,4].reduce(function(a,b){ callCount++; }, 0); callCount", "5");
callCount = 0;
shouldBe("[0,1,2,3,4].reduce(function(a,b){ callCount++; }); callCount", "4");
callCount = 0;
shouldBe("[1, 2, 3, 4].reduce(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount", "2");
callCount = 0;
shouldBe("[1, 2, 3, 4].reduce(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount", "4");
callCount = 0;
shouldBe("toObject([1, 2, 3, 4]).reduce(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount", "4");
callCount = 0;
shouldBe("toObject([1, 2, 3, 4]).reduce(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount", "4");
shouldBe("[[0,1], [2,3], [4,5]].reduce(function(a,b) {return a.concat(b);}, [])", "[0,1,2,3,4,5]");
shouldBe("toObject([[0,1], [2,3], [4,5]]).reduce(function(a,b) {return a.concat(b);}, [])", "[0,1,2,3,4,5]");
shouldBe("toObject([0,1,2,3,4,5]).reduce(function(a,b,i) {return a.concat([i,b]);}, [])", "[0,0,1,1,2,2,3,3,4,4,5,5]");
shouldBe("toUnorderedObject([[0,1], [2,3], [4,5]]).reduce(function(a,b) {return a.concat(b);}, [])", "[0,1,2,3,4,5]");
shouldBe("toUnorderedObject([0,1,2,3,4,5]).reduce(function(a,b,i) {return a.concat([i,b]);}, [])", "[0,0,1,1,2,2,3,3,4,4,5,5]");
shouldBe("[0,1,2,3,4,5].reduce(function(a,b,i) {return a.concat([i,b]);}, [])", "[0,0,1,1,2,2,3,3,4,4,5,5]");
shouldBe("[2,3].reduce(function() {'use strict'; return this;})", "undefined");

View File

@ -0,0 +1,64 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks the behavior of the reduceRight() method on a number of objects.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS [0,1,2,3].reduceRight(function(a,b){ return a + b; }) is 6
PASS [1,2,3].reduceRight(function(a,b){ return a + b; }) is 6
PASS [0,1,2,3].reduceRight(function(a,b){ return a + b; }, 4) is 10
PASS [1,2,3].reduceRight(function(a,b){ return a + b; }, 4) is 10
PASS toObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; }) is 6
PASS toObject([1,2,3]).reduceRight(function(a,b){ return a + b; }) is 6
PASS toObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; }, 4) is 10
PASS toObject([1,2,3]).reduceRight(function(a,b){ return a + b; }, 4) is 10
PASS toUnorderedObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; }) is 6
PASS toUnorderedObject([1,2,3]).reduceRight(function(a,b){ return a + b; }) is 6
PASS toUnorderedObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; }, 4) is 10
PASS toUnorderedObject([1,2,3]).reduceRight(function(a,b){ return a + b; }, 4) is 10
PASS sparseArray.reduceRight(function(a,b){ return a + b; }, 0) is 10
PASS toObject(sparseArray).reduceRight(function(a,b){ return a + b; }, 0) is 10
PASS sparseArray.reduceRight(function(a,b){ callCount++; }); callCount is 0
PASS toObject(sparseArray).reduceRight(function(a,b){ callCount++; }); callCount is 0
PASS sparseArray.reduceRight(function(a,b){ callCount++; }, 0); callCount is 1
PASS toObject(sparseArray).reduceRight(function(a,b){ callCount++; }, 0); callCount is 1
PASS [0,1,2,3,4].reduceRight(function(a,b){ callCount++; }, 0); callCount is 5
PASS [0,1,2,3,4].reduceRight(function(a,b){ callCount++; }); callCount is 4
PASS [1, 2, 3, 4].reduceRight(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount is 4
PASS [1, 2, 3, 4].reduceRight(function(a,b, i, thisObj){ thisObj.length = 1; callCount++; return a + b; }, 0); callCount is 2
PASS [1, 2, 3, 4].reduceRight(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount is 4
PASS toObject([1, 2, 3, 4]).reduceRight(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount is 4
PASS toObject([1, 2, 3, 4]).reduceRight(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount is 4
PASS [[0,1], [2,3], [4,5]].reduceRight(function(a,b) {return a.concat(b);}, []) is [4,5,2,3,0,1]
PASS toObject([[0,1], [2,3], [4,5]]).reduceRight(function(a,b) {return a.concat(b);}, []) is [4,5,2,3,0,1]
PASS toObject([0,1,2,3,4,5]).reduceRight(function(a,b,i) {return a.concat([i,b]);}, []) is [5,5,4,4,3,3,2,2,1,1,0,0]
PASS toUnorderedObject([[0,1], [2,3], [4,5]]).reduceRight(function(a,b) {return a.concat(b);}, []) is [4,5,2,3,0,1]
PASS toUnorderedObject([0,1,2,3,4,5]).reduceRight(function(a,b,i) {return a.concat([i,b]);}, []) is [5,5,4,4,3,3,2,2,1,1,0,0]
PASS [0,1,2,3,4,5].reduceRight(function(a,b,i) {return a.concat([i,b]);}, []) is [5,5,4,4,3,3,2,2,1,1,0,0]
PASS [2,3].reduceRight(function() {'use strict'; return this;}) is undefined
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,93 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks the behavior of the reduceRight() method on a number of objects."
);
function toObject(array) {
var o = {};
for (var i in array)
o[i] = array[i];
o.length = array.length;
o.reduceRight = Array.prototype.reduceRight;
return o;
}
function toUnorderedObject(array) {
var o = {};
var props = [];
for (var i in array)
props.push(i);
for (var i = props.length - 1; i >= 0; i--)
o[props[i]] = array[props[i]];
o.length = array.length;
o.reduceRight = Array.prototype.reduceRight;
return o;
}
shouldBe("[0,1,2,3].reduceRight(function(a,b){ return a + b; })", "6");
shouldBe("[1,2,3].reduceRight(function(a,b){ return a + b; })", "6");
shouldBe("[0,1,2,3].reduceRight(function(a,b){ return a + b; }, 4)", "10");
shouldBe("[1,2,3].reduceRight(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; })", "6");
shouldBe("toObject([1,2,3]).reduceRight(function(a,b){ return a + b; })", "6");
shouldBe("toObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toObject([1,2,3]).reduceRight(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toUnorderedObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; })", "6");
shouldBe("toUnorderedObject([1,2,3]).reduceRight(function(a,b){ return a + b; })", "6");
shouldBe("toUnorderedObject([0,1,2,3]).reduceRight(function(a,b){ return a + b; }, 4)", "10");
shouldBe("toUnorderedObject([1,2,3]).reduceRight(function(a,b){ return a + b; }, 4)", "10");
sparseArray = [];
sparseArray[10] = 10;
shouldBe("sparseArray.reduceRight(function(a,b){ return a + b; }, 0)", "10");
shouldBe("toObject(sparseArray).reduceRight(function(a,b){ return a + b; }, 0)", "10");
var callCount = 0;
shouldBe("sparseArray.reduceRight(function(a,b){ callCount++; }); callCount", "0");
callCount = 0;
shouldBe("toObject(sparseArray).reduceRight(function(a,b){ callCount++; }); callCount", "0");
var callCount = 0;
shouldBe("sparseArray.reduceRight(function(a,b){ callCount++; }, 0); callCount", "1");
callCount = 0;
shouldBe("toObject(sparseArray).reduceRight(function(a,b){ callCount++; }, 0); callCount", "1");
callCount = 0;
shouldBe("[0,1,2,3,4].reduceRight(function(a,b){ callCount++; }, 0); callCount", "5");
callCount = 0;
shouldBe("[0,1,2,3,4].reduceRight(function(a,b){ callCount++; }); callCount", "4");
callCount = 0;
shouldBe("[1, 2, 3, 4].reduceRight(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount", "4");
callCount = 0;
shouldBe("[1, 2, 3, 4].reduceRight(function(a,b, i, thisObj){ thisObj.length = 1; callCount++; return a + b; }, 0); callCount", "2");
callCount = 0;
shouldBe("[1, 2, 3, 4].reduceRight(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount", "4");
callCount = 0;
shouldBe("toObject([1, 2, 3, 4]).reduceRight(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount", "4");
callCount = 0;
shouldBe("toObject([1, 2, 3, 4]).reduceRight(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount", "4");
shouldBe("[[0,1], [2,3], [4,5]].reduceRight(function(a,b) {return a.concat(b);}, [])", "[4,5,2,3,0,1]");
shouldBe("toObject([[0,1], [2,3], [4,5]]).reduceRight(function(a,b) {return a.concat(b);}, [])", "[4,5,2,3,0,1]");
shouldBe("toObject([0,1,2,3,4,5]).reduceRight(function(a,b,i) {return a.concat([i,b]);}, [])", "[5,5,4,4,3,3,2,2,1,1,0,0]");
shouldBe("toUnorderedObject([[0,1], [2,3], [4,5]]).reduceRight(function(a,b) {return a.concat(b);}, [])", "[4,5,2,3,0,1]");
shouldBe("toUnorderedObject([0,1,2,3,4,5]).reduceRight(function(a,b,i) {return a.concat([i,b]);}, [])", "[5,5,4,4,3,3,2,2,1,1,0,0]");
shouldBe("[0,1,2,3,4,5].reduceRight(function(a,b,i) {return a.concat([i,b]);}, [])", "[5,5,4,4,3,3,2,2,1,1,0,0]");
shouldBe("[2,3].reduceRight(function() {'use strict'; return this;})", "undefined");

View File

@ -0,0 +1,34 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test puts an item in a big index and then tries to change it. It should change successfully.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS array[10001] is 5
PASS array[10002] is "b"
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,35 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test puts an item in a big index and then tries to change it. It should change successfully."
);
var array = [];
array[10001] = 0;
array[10001] = 5;
array[10002] = "a";
array[10002] = "b";
shouldBe('array[10001]', '5');
shouldBe('array[10002]', '"b"');

View File

@ -0,0 +1,34 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that a call to array.sort(compareFunction) works correctly for numeric comparisons (arg1 - arg2), and also for things that might look like numeric comparisons.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS [3,1,5,2,4].sort(doSort) is [1,2,3,4,5]
PASS [3,1,5,2,4].sort(dontSort) is [3,1,5,2,4]
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,39 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that a call to array.sort(compareFunction) works correctly for numeric comparisons (arg1 - arg2), and also for things that might look like numeric comparisons."
);
function doSort(x, y)
{
return x - y;
}
function dontSort(w, x, y)
{
return x - y;
}
shouldBe("[3,1,5,2,4].sort(doSort)", "[1,2,3,4,5]");
shouldBe("[3,1,5,2,4].sort(dontSort)", "[3,1,5,2,4]");

View File

@ -0,0 +1,32 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that a call to array.sort(compareFunction) does not crash from within a sort comparison function.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,40 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that a call to array.sort(compareFunction) does not crash from within a sort comparison function."
);
var numbers1 = [1, 2, 3, 4, 5, 6, 7];
var numbers2 = numbers1.slice();
function compareFn1(a, b) {
return b - a;
}
function compareFn2(a, b) {
numbers1.sort(compareFn1);
return b - a;
}
numbers2.sort(compareFn2);

View File

@ -0,0 +1,36 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Tests that we can quickly sort a small sparse array that has a large length.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
array[0] = 42
PASS result is "42"
PASS array.length is 10000001
PASS array[0] is 42
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,40 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"Tests that we can quickly sort a small sparse array that has a large length."
);
var array = [];
array[10000000] = 42;
array.sort();
var result = "";
for (var s in array) {
debug("array[" + s + "] = " + array[s]);
if (result)
result += ",";
result += array[s];
}
shouldBe("result", "\"42\"");
shouldBe("array.length", "10000001");
shouldBe("array[0]", "42");

View File

@ -0,0 +1,34 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that arrays and array like objects containing holes are sorted correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS testSort([,undefined,0,1]) is true
PASS testSort({length:4,1:undefined,2:0,3:1}) is true
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,35 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that arrays and array like objects containing holes are sorted correctly."
);
function testSort(x)
{
[].sort.call(x)
return x[0] < x[1] && x[2] === undefined && !(3 in x) && x.length == 4;
}
shouldBeTrue("testSort([,undefined,0,1])");
shouldBeTrue("testSort({length:4,1:undefined,2:0,3:1})");

View File

@ -0,0 +1,53 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests array.splice behavior.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS arr is ['a','b','c','d']
PASS arr.splice(2) is ['c','d']
PASS arr is ['a','b']
PASS arr.splice(0) is ['a','b']
PASS arr is []
PASS arr.splice() is []
PASS arr is ['a','b','c','d']
PASS arr.splice(undefined) is ['a','b','c','d']
PASS arr is []
PASS arr.splice(null) is ['a','b','c','d']
PASS arr is []
PASS arr.splice(100) is []
PASS arr is ['a','b','c','d']
PASS arr.splice(-1) is ['d']
PASS arr is ['a','b','c']
PASS arr.splice(2, undefined) is []
PASS arr.splice(2, null) is []
PASS arr.splice(2, -1) is []
PASS arr is ['a','b','c']
PASS arr.splice(2, 100) is ['c']
PASS arr is ['a','b']
PASS successfullyParsed is true
TEST COMPLETE

56
deps/v8/test/webkit/array-splice.js vendored Normal file
View File

@ -0,0 +1,56 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests array.splice behavior."
);
var arr = ['a','b','c','d'];
shouldBe("arr", "['a','b','c','d']");
shouldBe("arr.splice(2)", "['c','d']");
shouldBe("arr", "['a','b']");
shouldBe("arr.splice(0)", "['a','b']");
shouldBe("arr", "[]")
arr = ['a','b','c','d'];
shouldBe("arr.splice()", "[]")
shouldBe("arr", "['a','b','c','d']");
shouldBe("arr.splice(undefined)", "['a','b','c','d']")
shouldBe("arr", "[]");
arr = ['a','b','c','d'];
shouldBe("arr.splice(null)", "['a','b','c','d']")
shouldBe("arr", "[]");
arr = ['a','b','c','d'];
shouldBe("arr.splice(100)", "[]")
shouldBe("arr", "['a','b','c','d']");
shouldBe("arr.splice(-1)", "['d']")
shouldBe("arr", "['a','b','c']");
shouldBe("arr.splice(2, undefined)", "[]")
shouldBe("arr.splice(2, null)", "[]")
shouldBe("arr.splice(2, -1)", "[]")
shouldBe("arr", "['a','b','c']");
shouldBe("arr.splice(2, 100)", "['c']")
shouldBe("arr", "['a','b']");

View File

@ -0,0 +1,33 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks that toString and join share the same HashSet for visited elements.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS arr.join() is '1,2,,**'
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,36 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks that toString and join share the same HashSet for visited elements."
);
var arr = [1, 2];
var obj = {};
obj.__proto__.toString = function() { return "*" + arr + "*"; }
arr[2] = arr;
arr[3] = obj;
shouldBe("arr.join()", "'1,2,,**'");

View File

@ -0,0 +1,48 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that storing into something that is not array does not crash.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS result is "foo"
PASS result is "foo"
PASS result is undefined
PASS result is undefined
PASS result is undefined
PASS result is "foo"
PASS result is undefined
PASS result is "foo"
PASS result is "foo"
PASS result is undefined
PASS result is "foo"
PASS result is undefined
PASS result is undefined
PASS result is undefined
PASS result is "foo"
PASS result is "foo"
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,65 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that storing into something that is not array does not crash."
);
theCode = "\n\
function storeFooByValOrDoArithmetic(o, p1, p2, v) {\n\
var x;\n\
if (p1) {\n\
x = o.foo;\n\
} else {\n\
x = v;\n\
if (p2) {\n\
x--;\n\
} else {\n\
x++;\n\
}\n\
}\n\
x[5] = \"foo\";\n\
}\n\
\n\
function runTheTest(p1, p2) {\n\
var o = new Object();\n\
o.foo = new Object();\n\
storeFooByValOrDoArithmetic(o, p1, p2, 1);\n\
return o.foo[5];\n\
}\n";
function runWithPredicates(predicateArray) {
var myCode = theCode;
for (var i = 0; i < predicateArray.length; ++i) {
myCode += "result = runTheTest(" + predicateArray[i][0] + ", " + predicateArray[i][1] + ");\n";
myCode += "shouldBe(\"result\", " + predicateArray[i][2] + ");\n";
}
eval(myCode);
}
runWithPredicates([[true, true, "\"\\\"foo\\\"\""], [true, false, "\"\\\"foo\\\"\""], [false, true, "\"undefined\""], [false, false, "\"undefined\""]]);
runWithPredicates([[false, false, "\"undefined\""], [true, false, "\"\\\"foo\\\"\""], [false, true, "\"undefined\""], [true, true, "\"\\\"foo\\\"\""]]);
runWithPredicates([[true, true, "\"\\\"foo\\\"\""], [false, true, "\"undefined\""], [true, false, "\"\\\"foo\\\"\""], [false, false, "\"undefined\""]]);
runWithPredicates([[false, false, "\"undefined\""], [false, true, "\"undefined\""], [true, false, "\"\\\"foo\\\"\""], [true, true, "\"\\\"foo\\\"\""]]);

View File

@ -0,0 +1,32 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks for a crash in sort() that was seen on a particular input data set.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE

121
deps/v8/test/webkit/avl-crash.js vendored Normal file
View File

@ -0,0 +1,121 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks for a crash in sort() that was seen on a particular input data set."
);
function natcompare(a, b) {
if (a == b)
return 0;
return (a < b) ? -1 : 1;
}
SubwayData = [
"23rd St-Broadway ",
"45 Road-Court Sq",
"LIC-Court Sq",
"LIC-Court Sq",
"23rd St-Park Ave S",
"241st St",
"242nd St",
"25th Ave",
"25th St",
"28th St-7th Ave",
"28th St-Broadway",
"28th St-Park Ave S",
"2nd Ave-Houston St",
"30th Ave",
"33rd St",
"33rd St-Park Ave",
"34th St-6th Ave",
"34th St-7th Ave",
"34th St-8th Ave",
"36th Ave",
"36th St",
"36th St",
"39th Ave",
"3rd Ave-138th St",
"3rd Ave-149th St",
"3rd Ave-14th St",
"40th St",
"42nd St-5th Ave-6th Ave",
"42nd St-5th Ave-6th Ave",
"45th St",
"46th St",
"46th St",
"47-50th Sts-Rockefeller Center",
"49th St-7th Ave",
"50th St-New Utrecht Ave",
"9th Ave",
"90th St-Elmhurst Ave",
"96th St",
"96th St",
"96th St",
"9th St-4th Ave",
"Alabama Ave",
"Allerton Ave",
"Aqueduct-North Conduit Ave",
"Astor Place",
"Astoria Blvd",
"Atlantic Ave",
"Atlantic Ave-Pacific St",
"Ave H",
"Ave N",
"Ave P",
"Ave U",
"Ave U",
"Ave U",
"Ave X",
"Bay Pkwy",
"Bay Pkwy",
"Bay Pkwy-22nd Ave",
"Bay Ridge Ave",
"Baychester Ave",
"Beach 105th St",
"Beach 25th St",
"Beach 36th St",
"Beach 44th St",
"Beach 60th St",
"Beach 67th St",
"Beach 90th St",
"Beach 98th St",
"Bedford Ave",
"Bedford Park Blvd",
"Broadway",
"Broadway",
"Bronx Park East",
"Brook Ave",
"Buhre Ave",
"Burke Ave",
"Burnside Ave",
"Bushwick Ave",
"Uptown Bleecker St-Lafayette St",
"Downtown Bleecker St-Lafayette St",
"Canal Street",
"Canal Street",
"Canal Street",
"Canal-Church Sts"
];
SubwayData.sort(natcompare)

View File

@ -0,0 +1,38 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Ensure various bit operators correctly tag the final result value
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS aDouble>>27 is 0
PASS aDouble>>27|0 is 0
PASS aDouble>>0 is 100000000
PASS aDouble>>0|0 is 100000000
PASS aDouble|0 is 100000000
PASS (function(x){ return 2147483648>>>x; })(31) is 1
PASS successfullyParsed is true
TEST COMPLETE

33
deps/v8/test/webkit/bitops-type-tag.js vendored Normal file
View File

@ -0,0 +1,33 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Ensure various bit operators correctly tag the final result value");
aDouble = 100000000.5;
shouldBe("aDouble>>27", "0");
shouldBe("aDouble>>27|0", "0");
shouldBe("aDouble>>0", "100000000");
shouldBe("aDouble>>0|0", "100000000");
shouldBe("aDouble|0", "100000000");
shouldBe("(function(x){ return 2147483648>>>x; })(31)", "1");

View File

@ -0,0 +1,48 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that arguments predicted to be boolean are checked.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS predictBooleanArgument(true) is "yes"
PASS predictBooleanArgument(false) is "no"
PASS predictBooleanArgument(true) is "yes"
PASS predictBooleanArgument(false) is "no"
PASS predictBooleanArgument(0) is "no"
PASS predictBooleanArgument(1) is "yes"
PASS predictBooleanArgument(2) is "yes"
PASS predictBooleanArgument(3) is "yes"
PASS predictBooleanArgument(4) is "yes"
PASS predictBooleanArgument(true) is "yes"
PASS predictBooleanArgument(false) is "no"
PASS predictBooleanArgument(0) is "no"
PASS predictBooleanArgument(1) is "yes"
PASS predictBooleanArgument(2) is "yes"
PASS predictBooleanArgument(3) is "yes"
PASS predictBooleanArgument(4) is "yes"
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,68 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that arguments predicted to be boolean are checked."
);
function predictBooleanArgument(b) {
if (b) {
return "yes";
} else {
return "no";
}
}
shouldBe("predictBooleanArgument(true)", "\"yes\"");
shouldBe("predictBooleanArgument(false)", "\"no\"");
for (var i = 0; i < 1000; ++i) {
predictBooleanArgument(true);
predictBooleanArgument(false);
}
shouldBe("predictBooleanArgument(true)", "\"yes\"");
shouldBe("predictBooleanArgument(false)", "\"no\"");
shouldBe("predictBooleanArgument(0)", "\"no\"");
shouldBe("predictBooleanArgument(1)", "\"yes\"");
shouldBe("predictBooleanArgument(2)", "\"yes\"");
shouldBe("predictBooleanArgument(3)", "\"yes\"");
shouldBe("predictBooleanArgument(4)", "\"yes\"");
for (var i = 0; i < 1000; ++i) {
predictBooleanArgument(0);
predictBooleanArgument(1);
predictBooleanArgument(2);
predictBooleanArgument(3);
predictBooleanArgument(4);
}
shouldBe("predictBooleanArgument(true)", "\"yes\"");
shouldBe("predictBooleanArgument(false)", "\"no\"");
shouldBe("predictBooleanArgument(0)", "\"no\"");
shouldBe("predictBooleanArgument(1)", "\"yes\"");
shouldBe("predictBooleanArgument(2)", "\"yes\"");
shouldBe("predictBooleanArgument(3)", "\"yes\"");
shouldBe("predictBooleanArgument(4)", "\"yes\"");

View File

@ -0,0 +1,37 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This tests that converting a boxed double to an integer does not crash the register allocator.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS boxedDoubleToInt(1, 2) is 3.5
PASS boxedDoubleToInt(3, 4) is 4.5
PASS boxedDoubleToInt(5, 6) is 7.5
PASS boxedDoubleToInt(7, 8) is 8.5
PASS boxedDoubleToInt(9, 10) is 11.5
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,38 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This tests that converting a boxed double to an integer does not crash the register allocator."
);
function boxedDoubleToInt(x, y) {
var y = x / 2;
var z = y + 2;
return (y | 1) + z;
}
shouldBe("boxedDoubleToInt(1, 2)", "3.5");
shouldBe("boxedDoubleToInt(3, 4)", "4.5");
shouldBe("boxedDoubleToInt(5, 6)", "7.5");
shouldBe("boxedDoubleToInt(7, 8)", "8.5");
shouldBe("boxedDoubleToInt(9, 10)", "11.5");

View File

@ -0,0 +1,41 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test to make sure we don't incorrectly insert a semi colon after a break statement
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS do { if(0) break
;else true; } while (0) is true
PASS do { if(0) continue
;else true; } while (0) is true
PASS (function(){if (0) return
;else return true;})() is true
PASS do { if(0) throw 'x';else true; } while (0) is true
PASS if (0) throw
'Shouldn't have parsed this.'; threw exception SyntaxError: Illegal newline after throw.
PASS successfullyParsed is true
TEST COMPLETE

30
deps/v8/test/webkit/break-ASI.js vendored Normal file
View File

@ -0,0 +1,30 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Test to make sure we don't incorrectly insert a semi colon after a break statement");
shouldBeTrue("do { if(0) break\n;else true; } while (0)")
shouldBeTrue("do { if(0) continue\n;else true; } while (0)")
shouldBeTrue("(function(){if (0) return\n;else return true;})()")
shouldBeTrue("do { if(0) throw 'x';else true; } while (0)")
shouldThrow("if (0) throw\n'Shouldn\'t have parsed this.';")

View File

@ -0,0 +1,35 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This test checks that uninitialized parameters for cached call functions correctly defaults to undefined.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS arg4 is undefined.
PASS arg5 is undefined.
PASS arg6 is undefined.
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,66 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
"This test checks that uninitialized parameters for cached call functions correctly defaults to undefined."
);
function doForEach(arr) {
function callback(element, index, array, arg4, arg5, arg6) {
function shouldBeUndefined(_a) {
var exception;
var _av;
try {
_av = eval(_a);
} catch (e) {
exception = e;
}
if (exception)
testFailed(_a + " should be undefined. Threw exception " + exception);
else if (typeof _av == "undefined")
testPassed(_a + " is undefined.");
else
testFailed(_a + " should be undefined. Was " + _av);
}
shouldBeUndefined("arg4");
shouldBeUndefined("arg5");
shouldBeUndefined("arg6");
}
arr.forEach(callback);
}
function callAfterRecursingForDepth(depth, func, arr) {
if (depth > 0) {
callAfterRecursingForDepth(depth - 1, func, arr);
} else {
func(arr);
}
}
var arr = [1];
callAfterRecursingForDepth(20, doForEach, arr);

View File

@ -0,0 +1,34 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test to ensure that the registerfile is grown correctly when calling apply
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Did not crash using apply
PASS Did not crash using apply
PASS successfullyParsed is true
TEST COMPLETE

33
deps/v8/test/webkit/call-apply-crash.js vendored Normal file
View File

@ -0,0 +1,33 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description("Test to ensure that the registerfile is grown correctly when calling apply");
function testLog() { testPassed(this); }
(function () {
Function.prototype.call.apply(testLog, arguments);
})('Did not crash using apply', 0, 0); // needs 3+ arguments
(function () {
arguments; // reify the arguments object.
Function.prototype.call.apply(testLog, arguments);
})('Did not crash using apply', 0, 0); // needs 3+ arguments

110
deps/v8/test/webkit/char-at-expected.txt vendored Normal file
View File

@ -0,0 +1,110 @@
# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This is a test of the charAt and charCodeAt string functions.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS "".charAt() is ""
PASS "".charCodeAt() is NaN
PASS "".charAt(undefined) is ""
PASS "".charCodeAt(undefined) is NaN
PASS "".charAt(0) is ""
PASS "".charCodeAt(0) is NaN
PASS "".charAt(null) is ""
PASS "".charCodeAt(null) is NaN
PASS "".charAt(false) is ""
PASS "".charCodeAt(false) is NaN
PASS "".charAt(true) is ""
PASS "".charCodeAt(true) is NaN
PASS "".charAt(0) is ""
PASS "".charCodeAt(0) is NaN
PASS "".charAt(0.1) is ""
PASS "".charCodeAt(0.1) is NaN
PASS "".charAt(999) is ""
PASS "".charCodeAt(999) is NaN
PASS "".charAt(Infinity) is ""
PASS "".charCodeAt(Infinity) is NaN
PASS "".charAt(-1) is ""
PASS "".charCodeAt(-1) is NaN
PASS "".charAt(-Infinity) is ""
PASS "".charCodeAt(-Infinity) is NaN
PASS "".charAt(NaN) is ""
PASS "".charCodeAt(NaN) is NaN
PASS "x".charAt() is "x"
PASS "x".charCodeAt() is 120
PASS "x".charAt(undefined) is "x"
PASS "x".charCodeAt(undefined) is 120
PASS "x".charAt(0) is "x"
PASS "x".charCodeAt(0) is 120
PASS "x".charAt(null) is "x"
PASS "x".charCodeAt(null) is 120
PASS "x".charAt(false) is "x"
PASS "x".charCodeAt(false) is 120
PASS "x".charAt(true) is ""
PASS "x".charCodeAt(true) is NaN
PASS "x".charAt(0) is "x"
PASS "x".charCodeAt(0) is 120
PASS "x".charAt(0.1) is "x"
PASS "x".charCodeAt(0.1) is 120
PASS "x".charAt(999) is ""
PASS "x".charCodeAt(999) is NaN
PASS "x".charAt(Infinity) is ""
PASS "x".charCodeAt(Infinity) is NaN
PASS "x".charAt(-1) is ""
PASS "x".charCodeAt(-1) is NaN
PASS "x".charAt(-Infinity) is ""
PASS "x".charCodeAt(-Infinity) is NaN
PASS "x".charAt(NaN) is "x"
PASS "x".charCodeAt(NaN) is 120
PASS "xy".charAt() is "x"
PASS "xy".charCodeAt() is 120
PASS "xy".charAt(undefined) is "x"
PASS "xy".charCodeAt(undefined) is 120
PASS "xy".charAt(0) is "x"
PASS "xy".charCodeAt(0) is 120
PASS "xy".charAt(null) is "x"
PASS "xy".charCodeAt(null) is 120
PASS "xy".charAt(false) is "x"
PASS "xy".charCodeAt(false) is 120
PASS "xy".charAt(true) is "y"
PASS "xy".charCodeAt(true) is 121
PASS "xy".charAt(0) is "x"
PASS "xy".charCodeAt(0) is 120
PASS "xy".charAt(0.1) is "x"
PASS "xy".charCodeAt(0.1) is 120
PASS "xy".charAt(999) is ""
PASS "xy".charCodeAt(999) is NaN
PASS "xy".charAt(Infinity) is ""
PASS "xy".charCodeAt(Infinity) is NaN
PASS "xy".charAt(-1) is ""
PASS "xy".charCodeAt(-1) is NaN
PASS "xy".charAt(-Infinity) is ""
PASS "xy".charCodeAt(-Infinity) is NaN
PASS "xy".charAt(NaN) is "x"
PASS "xy".charCodeAt(NaN) is 120
PASS successfullyParsed is true
TEST COMPLETE

131
deps/v8/test/webkit/char-at.js vendored Normal file
View File

@ -0,0 +1,131 @@
// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
'This is a test of the charAt and charCodeAt string functions.'
);
var undefined;
var cases = [
["", "omitted"],
["", undefined],
["", 0],
["", null],
["", false],
["", true],
["", 0.0],
["", 0.1],
["", 999],
["", 1/0],
["", -1],
["", -1/0],
["", 0/0],
["x", "omitted"],
["x", undefined],
["x", 0],
["x", null],
["x", false],
["x", true],
["x", 0.0],
["x", 0.1],
["x", 999],
["x", 1/0],
["x", -1],
["x", -1/0],
["x", 0/0],
["xy", "omitted"],
["xy", undefined],
["xy", 0],
["xy", null],
["xy", false],
["xy", true],
["xy", 0.0],
["xy", 0.1],
["xy", 999],
["xy", 1/0],
["xy", -1],
["xy", -1/0],
["xy", 0/0],
];
var answers = [['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['"x"', '120'],
['"x"', '120'],
['"x"', '120'],
['"x"', '120'],
['"x"', '120'],
['""', 'NaN'],
['"x"', '120'],
['"x"', '120'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['"x"', '120'],
['"x"', '120'],
['"x"', '120'],
['"x"', '120'],
['"x"', '120'],
['"x"', '120'],
['"y"', '121'],
['"x"', '120'],
['"x"', '120'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['""', 'NaN'],
['"x"', '120']];
for (var i = 0; i < cases.length; ++i)
{
var item = cases[i];
var result = answers[i];
if (item[1] == "omitted") {
shouldBe('"' + item[0] + '".charAt()', result[0]);
if (result[1] == 'NaN')
shouldBeNaN('"' + item[0] + '".charCodeAt()');
else
shouldBe('"' + item[0] + '".charCodeAt()', result[1]);
} else {
shouldBe('"' + item[0] + '".charAt(' + item[1] + ')', result[0]);
if (result[1] == 'NaN')
shouldBeNaN('"' + item[0] + '".charCodeAt(' + item[1] + ')');
else
shouldBe('"' + item[0] + '".charCodeAt(' + item[1] + ')', result[1]);
}
}

View File

@ -0,0 +1,94 @@
Tests for ES6 class constructor return values
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Base class
PASS (new BaseNoReturn) instanceof BaseNoReturn is true
PASS (new BaseReturnImplicit) instanceof BaseReturnImplicit is true
PASS (new BaseReturnImplicit) !== undefined is true
PASS (new BaseReturnUndefined) instanceof BaseReturnUndefined is true
PASS (new BaseReturnUndefined) !== undefined is true
PASS (new BaseReturnThis) instanceof BaseReturnThis is true
PASS (new BaseReturnObject) instanceof BaseReturnObject is false
PASS typeof (new BaseReturnObject) === "object" is true
PASS (new BaseReturnObject2) instanceof BaseReturnObject is false
PASS (new BaseReturnObject2) === globalVariable is true
PASS (new BaseReturnString) instanceof BaseReturnString is true
PASS typeof (new BaseReturnString) !== "string" is true
PASS (new BaseReturnNumber) instanceof BaseReturnNumber is true
PASS typeof (new BaseReturnNumber) !== "number" is true
PASS (new BaseReturnNull) instanceof BaseReturnNull is true
PASS (new BaseReturnNull) !== null is true
PASS (new BaseReturnSymbol) instanceof BaseReturnSymbol is true
PASS (new BaseReturnSymbol) !== globalSymbol is true
PASS (new BaseThrow) threw exception Thrown Exception String.
Function constructor (non-class)
PASS (new FunctionNoReturn) instanceof FunctionNoReturn is true
PASS (new FunctionReturnImplicit) instanceof FunctionReturnImplicit is true
PASS (new FunctionReturnImplicit) !== undefined is true
PASS (new FunctionReturnUndefined) instanceof FunctionReturnUndefined is true
PASS (new FunctionReturnUndefined) !== undefined is true
PASS (new FunctionReturnThis) instanceof FunctionReturnThis is true
PASS (new FunctionReturnObject) instanceof FunctionReturnObject is false
PASS typeof (new FunctionReturnObject) === "object" is true
PASS (new FunctionReturnObject2) instanceof FunctionReturnObject is false
PASS (new FunctionReturnObject2) === globalVariable is true
PASS (new FunctionReturnString) instanceof FunctionReturnString is true
PASS typeof (new FunctionReturnString) !== "string" is true
PASS (new FunctionReturnNumber) instanceof FunctionReturnNumber is true
PASS typeof (new FunctionReturnNumber) !== "number" is true
PASS (new FunctionReturnNull) instanceof FunctionReturnNull is true
PASS (new FunctionReturnNull) !== null is true
PASS (new FunctionReturnSymbol) instanceof FunctionReturnSymbol is true
PASS (new FunctionReturnSymbol) !== globalSymbol is true
PASS (new FunctionThrow) threw exception Thrown Exception String.
Derived class calling super()
PASS (new DerivedNoReturn) instanceof DerivedNoReturn is true
PASS (new DerivedReturnImplicit) instanceof DerivedReturnImplicit is true
PASS (new DerivedReturnImplicit) !== undefined is true
PASS (new DerivedReturnUndefined) instanceof DerivedReturnUndefined is true
PASS (new DerivedReturnUndefined) !== undefined is true
PASS (new DerivedReturnThis) instanceof DerivedReturnThis is true
PASS (new DerivedReturnObject) instanceof DerivedReturnObject is false
PASS typeof (new DerivedReturnObject) === "object" is true
PASS (new DerivedReturnObject2) instanceof DerivedReturnObject2 is false
PASS (new DerivedReturnObject2) === globalVariable is true
PASS (new DerivedReturnString) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedReturnNumber) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedReturnNull) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedReturnSymbol) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedThrow) threw exception Thrown Exception String.
Derived class not calling super()
PASS (new DerivedNoSuperNoReturn) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS (new DerivedNoSuperReturnImplicit) threw exception ReferenceError: DerivedNoSuperReturnImplicit is not defined.
PASS (new DerivedNoSuperReturnUndefined) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS (new DerivedNoSuperReturnThis) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS (new DerivedNoSuperReturnObject) did not throw exception.
PASS (new DerivedNoSuperReturnObject2) did not throw exception.
PASS (new DerivedNoSuperReturnString) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedNoSuperReturnNumber) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedNoSuperReturnNull) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedNoSuperReturnSymbol) threw exception TypeError: Derived constructors may only return object or undefined.
PASS (new DerivedNoSuperThrow) threw exception Thrown Exception String.
Derived class with default constructor and base class returning different values
PASS (new DerivedDefaultConstructorWithBaseNoReturn) instanceof DerivedDefaultConstructorWithBaseNoReturn is true
PASS (new DerivedDefaultConstructorWithBaseReturnImplicit) instanceof DerivedDefaultConstructorWithBaseReturnImplicit is true
PASS (new DerivedDefaultConstructorWithBaseReturnUndefined) instanceof DerivedDefaultConstructorWithBaseReturnUndefined is true
PASS (new DerivedDefaultConstructorWithBaseReturnObject) instanceof DerivedDefaultConstructorWithBaseReturnObject is false
PASS typeof (new DerivedDefaultConstructorWithBaseReturnObject) === "object" is true
PASS (new DerivedDefaultConstructorWithBaseReturnObject2) instanceof DerivedDefaultConstructorWithBaseReturnObject2 is false
PASS (new DerivedDefaultConstructorWithBaseReturnObject2) === globalVariable is true
PASS (new DerivedDefaultConstructorWithBaseReturnThis) instanceof DerivedDefaultConstructorWithBaseReturnThis is true
PASS (new DerivedDefaultConstructorWithBaseReturnString) instanceof DerivedDefaultConstructorWithBaseReturnString is true
PASS (new DerivedDefaultConstructorWithBaseReturnNumber) instanceof DerivedDefaultConstructorWithBaseReturnNumber is true
PASS (new DerivedDefaultConstructorWithBaseReturnNull) instanceof DerivedDefaultConstructorWithBaseReturnNull is true
PASS (new DerivedDefaultConstructorWithBaseReturnSymbol) instanceof DerivedDefaultConstructorWithBaseReturnSymbol is true
PASS (new DerivedDefaultConstructorWithBaseThrow) threw exception Thrown Exception String.
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,215 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for ES6 class constructor return values');
// ES6
// - 9.2.2 [[Construct]] (ECMAScript Function Objects)
// - 12.3.5.1 Runtime Semantics: Evaluation (The super Keyword)
// - 14.5.14 Runtime Semantics: ClassDefinitionEvaluation (Default Constructor)
var globalVariable = {name:"globalVariable"};
var globalSymbol = Symbol();
debug('Base class');
class BaseNoReturn { constructor() { } };
class BaseReturnImplicit { constructor() { return; } };
class BaseReturnUndefined { constructor() { return undefined; } };
class BaseReturnThis { constructor() { return this; } };
class BaseReturnObject { constructor() { return {a:1}; } };
class BaseReturnObject2 { constructor() { return globalVariable; } };
class BaseReturnString { constructor() { return "test"; } };
class BaseReturnNumber { constructor() { return 1; } };
class BaseReturnNull { constructor() { return null; } };
class BaseReturnSymbol { constructor() { return Symbol(); } };
class BaseThrow { constructor() { throw "Thrown Exception String"; } };
// Base - Implicit => return this.
shouldBeTrue('(new BaseNoReturn) instanceof BaseNoReturn');
// Base - Early return => return this.
shouldBeTrue('(new BaseReturnImplicit) instanceof BaseReturnImplicit');
shouldBeTrue('(new BaseReturnImplicit) !== undefined');
shouldBeTrue('(new BaseReturnUndefined) instanceof BaseReturnUndefined');
shouldBeTrue('(new BaseReturnUndefined) !== undefined');
// Base - return this => return this.
shouldBeTrue('(new BaseReturnThis) instanceof BaseReturnThis');
// Base - return Object => return object, not instance.
shouldBeFalse('(new BaseReturnObject) instanceof BaseReturnObject');
shouldBeTrue('typeof (new BaseReturnObject) === "object"');
shouldBeFalse('(new BaseReturnObject2) instanceof BaseReturnObject');
shouldBeTrue('(new BaseReturnObject2) === globalVariable');
// Base - return non-Object => return this.
shouldBeTrue('(new BaseReturnString) instanceof BaseReturnString');
shouldBeTrue('typeof (new BaseReturnString) !== "string"');
shouldBeTrue('(new BaseReturnNumber) instanceof BaseReturnNumber');
shouldBeTrue('typeof (new BaseReturnNumber) !== "number"');
shouldBeTrue('(new BaseReturnNull) instanceof BaseReturnNull');
shouldBeTrue('(new BaseReturnNull) !== null');
shouldBeTrue('(new BaseReturnSymbol) instanceof BaseReturnSymbol');
shouldBeTrue('(new BaseReturnSymbol) !== globalSymbol');
// Base - throw => throw
shouldThrow('(new BaseThrow)');
// Same behavior for Functions.
debug(''); debug('Function constructor (non-class)');
function FunctionNoReturn() { };
function FunctionReturnImplicit() { return; };
function FunctionReturnUndefined() { return undefined; };
function FunctionReturnThis() { return this; };
function FunctionReturnObject() { return {a:1}; };
function FunctionReturnObject2() { return globalVariable; };
function FunctionReturnString() { return "test"; };
function FunctionReturnNumber() { return 1; };
function FunctionReturnNull() { return null; };
function FunctionReturnSymbol() { return Symbol(); };
function FunctionThrow() { throw "Thrown Exception String"; };
shouldBeTrue('(new FunctionNoReturn) instanceof FunctionNoReturn');
shouldBeTrue('(new FunctionReturnImplicit) instanceof FunctionReturnImplicit');
shouldBeTrue('(new FunctionReturnImplicit) !== undefined');
shouldBeTrue('(new FunctionReturnUndefined) instanceof FunctionReturnUndefined');
shouldBeTrue('(new FunctionReturnUndefined) !== undefined');
shouldBeTrue('(new FunctionReturnThis) instanceof FunctionReturnThis');
shouldBeFalse('(new FunctionReturnObject) instanceof FunctionReturnObject');
shouldBeTrue('typeof (new FunctionReturnObject) === "object"');
shouldBeFalse('(new FunctionReturnObject2) instanceof FunctionReturnObject');
shouldBeTrue('(new FunctionReturnObject2) === globalVariable');
shouldBeTrue('(new FunctionReturnString) instanceof FunctionReturnString');
shouldBeTrue('typeof (new FunctionReturnString) !== "string"');
shouldBeTrue('(new FunctionReturnNumber) instanceof FunctionReturnNumber');
shouldBeTrue('typeof (new FunctionReturnNumber) !== "number"');
shouldBeTrue('(new FunctionReturnNull) instanceof FunctionReturnNull');
shouldBeTrue('(new FunctionReturnNull) !== null');
shouldBeTrue('(new FunctionReturnSymbol) instanceof FunctionReturnSymbol');
shouldBeTrue('(new FunctionReturnSymbol) !== globalSymbol');
shouldThrow('(new FunctionThrow)');
debug(''); debug('Derived class calling super()');
class DerivedNoReturn extends BaseNoReturn { constructor() { super(); } };
class DerivedReturnImplicit extends BaseNoReturn { constructor() { super(); return; } };
class DerivedReturnUndefined extends BaseNoReturn { constructor() { super(); return undefined; } };
class DerivedReturnThis extends BaseNoReturn { constructor() { super(); return this; } };
class DerivedReturnObject extends BaseNoReturn { constructor() { super(); return {a:1}; } };
class DerivedReturnObject2 extends BaseNoReturn { constructor() { super(); return globalVariable; } };
class DerivedReturnString extends BaseNoReturn { constructor() { super(); return "test"; } };
class DerivedReturnNumber extends BaseNoReturn { constructor() { super(); return 1; } };
class DerivedReturnNull extends BaseNoReturn { constructor() { super(); return null; } };
class DerivedReturnSymbol extends BaseNoReturn { constructor() { super(); return globalSymbol; } };
class DerivedThrow extends BaseNoReturn { constructor() { super(); throw "Thrown Exception String"; } };
// Derived - Implicit => return this.
shouldBeTrue('(new DerivedNoReturn) instanceof DerivedNoReturn');
// Derived - Early return => return this.
shouldBeTrue('(new DerivedReturnImplicit) instanceof DerivedReturnImplicit');
shouldBeTrue('(new DerivedReturnImplicit) !== undefined');
shouldBeTrue('(new DerivedReturnUndefined) instanceof DerivedReturnUndefined');
shouldBeTrue('(new DerivedReturnUndefined) !== undefined');
// Derived - return this => return this.
shouldBeTrue('(new DerivedReturnThis) instanceof DerivedReturnThis');
// Derived - return Object => return object, not instance.
shouldBeFalse('(new DerivedReturnObject) instanceof DerivedReturnObject');
shouldBeTrue('typeof (new DerivedReturnObject) === "object"');
shouldBeFalse('(new DerivedReturnObject2) instanceof DerivedReturnObject2');
shouldBeTrue('(new DerivedReturnObject2) === globalVariable');
// Derived - return non-Object => exception.
shouldThrow('(new DerivedReturnString)');
shouldThrow('(new DerivedReturnNumber)');
shouldThrow('(new DerivedReturnNull)');
shouldThrow('(new DerivedReturnSymbol)');
shouldThrow('(new DerivedThrow)');
debug(''); debug('Derived class not calling super()');
class DerivedNoSuperNoReturn extends BaseNoReturn { constructor() { } };
class DerivedNoSuperReturn extends BaseNoReturn { constructor() { return; } };
class DerivedNoSuperReturnUndefined extends BaseNoReturn { constructor() { return undefined; } };
class DerivedNoSuperReturnObject extends BaseNoReturn { constructor() { return {a:1}; } };
class DerivedNoSuperReturnObject2 extends BaseNoReturn { constructor() { return globalVariable; } };
class DerivedNoSuperReturnThis extends BaseNoReturn { constructor() { return this; } };
class DerivedNoSuperReturnString extends BaseNoReturn { constructor() { return "test"; } };
class DerivedNoSuperReturnNumber extends BaseNoReturn { constructor() { return 1; } };
class DerivedNoSuperReturnNull extends BaseNoReturn { constructor() { return null; } };
class DerivedNoSuperReturnSymbol extends BaseNoReturn { constructor() { return globalSymbol; } };
class DerivedNoSuperThrow extends BaseNoReturn { constructor() { throw "Thrown Exception String"; } };
// Derived without super() - Implicit => return this => TDZ.
shouldThrow('(new DerivedNoSuperNoReturn)');
// Derived without super() - Early return => return this => TDZ.
shouldThrow('(new DerivedNoSuperReturnImplicit)');
shouldThrow('(new DerivedNoSuperReturnUndefined)');
// Derived without super() - return this => return this => TDZ
shouldThrow('(new DerivedNoSuperReturnThis)');
// Derived without super() - return Object => no this access => return object, not instance
shouldNotThrow('(new DerivedNoSuperReturnObject)');
shouldNotThrow('(new DerivedNoSuperReturnObject2)');
// Derived without super() - return non-Object => exception
shouldThrow('(new DerivedNoSuperReturnString)'); // TypeError
shouldThrow('(new DerivedNoSuperReturnNumber)'); // TypeError
shouldThrow('(new DerivedNoSuperReturnNull)'); // TypeError
shouldThrow('(new DerivedNoSuperReturnSymbol)'); // TypeError
shouldThrow('(new DerivedNoSuperThrow)'); // Thrown exception
debug(''); debug('Derived class with default constructor and base class returning different values');
class DerivedDefaultConstructorWithBaseNoReturn extends BaseNoReturn { };
class DerivedDefaultConstructorWithBaseReturnImplicit extends BaseReturnImplicit { };
class DerivedDefaultConstructorWithBaseReturnUndefined extends BaseReturnUndefined { };
class DerivedDefaultConstructorWithBaseReturnThis extends BaseReturnThis { };
class DerivedDefaultConstructorWithBaseReturnObject extends BaseReturnObject { };
class DerivedDefaultConstructorWithBaseReturnObject2 extends BaseReturnObject2 { };
class DerivedDefaultConstructorWithBaseReturnString extends BaseReturnString { };
class DerivedDefaultConstructorWithBaseReturnNumber extends BaseReturnNumber { };
class DerivedDefaultConstructorWithBaseReturnNull extends BaseReturnNull { };
class DerivedDefaultConstructorWithBaseReturnSymbol extends BaseReturnSymbol { };
class DerivedDefaultConstructorWithBaseThrow extends BaseThrow { };
// Derived default constructor - implicit "super(...arguments)" return the result of the base (Object or this).
shouldBeTrue('(new DerivedDefaultConstructorWithBaseNoReturn) instanceof DerivedDefaultConstructorWithBaseNoReturn');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnImplicit) instanceof DerivedDefaultConstructorWithBaseReturnImplicit');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnUndefined) instanceof DerivedDefaultConstructorWithBaseReturnUndefined');
shouldBeFalse('(new DerivedDefaultConstructorWithBaseReturnObject) instanceof DerivedDefaultConstructorWithBaseReturnObject');
shouldBeTrue('typeof (new DerivedDefaultConstructorWithBaseReturnObject) === "object"');
shouldBeFalse('(new DerivedDefaultConstructorWithBaseReturnObject2) instanceof DerivedDefaultConstructorWithBaseReturnObject2');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnObject2) === globalVariable');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnThis) instanceof DerivedDefaultConstructorWithBaseReturnThis');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnString) instanceof DerivedDefaultConstructorWithBaseReturnString');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnNumber) instanceof DerivedDefaultConstructorWithBaseReturnNumber');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnNull) instanceof DerivedDefaultConstructorWithBaseReturnNull');
shouldBeTrue('(new DerivedDefaultConstructorWithBaseReturnSymbol) instanceof DerivedDefaultConstructorWithBaseReturnSymbol');
shouldThrow('(new DerivedDefaultConstructorWithBaseThrow)');
var successfullyParsed = true;

View File

@ -0,0 +1,16 @@
Tests for calling the constructors of ES6 classes
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS new A did not throw exception.
PASS A() threw exception TypeError: Class constructor A cannot be invoked without 'new'.
PASS new B did not throw exception.
PASS B() threw exception TypeError: Class constructor B cannot be invoked without 'new'.
PASS new (class { constructor() {} })() did not throw exception.
PASS (class { constructor() {} })() threw exception TypeError: Class constructors cannot be invoked without 'new'.
PASS new (class extends null { constructor() { super() } })() threw exception TypeError: Super constructor null of anonymous class is not a constructor.
PASS (class extends null { constructor() { super() } })() threw exception TypeError: Class constructors cannot be invoked without 'new'.
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,38 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for calling the constructors of ES6 classes');
class A { constructor() {} };
class B extends A { constructor() { super() } };
shouldNotThrow('new A');
shouldThrow('A()', '"TypeError: Class constructor A cannot be invoked without \'new\'"');
shouldNotThrow('new B');
shouldThrow('B()', '"TypeError: Class constructor B cannot be invoked without \'new\'"');
shouldNotThrow('new (class { constructor() {} })()');
shouldThrow('(class { constructor() {} })()', '"TypeError: Class constructors cannot be invoked without \'new\'"');
shouldThrow('new (class extends null { constructor() { super() } })()', '"TypeError: Super constructor null of anonymous class is not a constructor"');
shouldThrow('(class extends null { constructor() { super() } })()', '"TypeError: Class constructors cannot be invoked without \'new\'"');
var successfullyParsed = true;

View File

@ -0,0 +1,43 @@
Tests for ES6 class syntax declarations
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS constructorCallCount is 0
PASS A.someStaticMethod() is staticMethodValue
PASS A.someStaticGetter is getterValue
PASS setterValue = undefined; A.someStaticSetter = 123; setterValue is 123
PASS (new A).someInstanceMethod() is instanceMethodValue
PASS constructorCallCount is 1
PASS (new A).someGetter is getterValue
PASS constructorCallCount is 2
PASS (new A).someGetter is getterValue
PASS setterValue = undefined; (new A).someSetter = 789; setterValue is 789
PASS (new A).__proto__ is A.prototype
PASS A.prototype.constructor is A
PASS class threw exception SyntaxError: Unexpected end of input.
PASS class [ threw exception SyntaxError: Unexpected token '['.
PASS class { threw exception SyntaxError: Unexpected token '{'.
PASS class X { threw exception SyntaxError: Unexpected end of input.
PASS class X { ( } threw exception SyntaxError: Unexpected token '('.
PASS class X {} did not throw exception.
PASS class X { constructor() {} constructor() {} } threw exception SyntaxError: A class may only have one constructor.
PASS class X { get constructor() {} } threw exception SyntaxError: Class constructor may not be an accessor.
PASS class X { set constructor() {} } threw exception SyntaxError: Class constructor may not be an accessor.
PASS class X { constructor() {} static constructor() { return staticMethodValue; } } did not throw exception.
PASS class X { constructor() {} static constructor() { return staticMethodValue; } }; X.constructor() is staticMethodValue
PASS class X { constructor() {} static prototype() {} } threw exception SyntaxError: Classes may not have a static property named 'prototype'.
PASS class X { constructor() {} static get prototype() {} } threw exception SyntaxError: Classes may not have a static property named 'prototype'.
PASS class X { constructor() {} static set prototype() {} } threw exception SyntaxError: Classes may not have a static property named 'prototype'.
PASS class X { constructor() {} prototype() { return instanceMethodValue; } } did not throw exception.
PASS class X { constructor() {} prototype() { return instanceMethodValue; } }; (new X).prototype() is instanceMethodValue
PASS class X { constructor() {} set foo(a) {} } did not throw exception.
PASS class X { constructor() {} set foo({x, y}) {} } did not throw exception.
PASS class X { constructor() {} set foo() {} } threw exception SyntaxError: Setter must have exactly one formal parameter..
PASS class X { constructor() {} set foo(a, b) {} } threw exception SyntaxError: Setter must have exactly one formal parameter..
PASS class X { constructor() {} get foo() {} } did not throw exception.
PASS class X { constructor() {} get foo(x) {} } threw exception SyntaxError: Getter must not have any formal parameters..
PASS class X { constructor() {} get foo({x, y}) {} } threw exception SyntaxError: Getter must not have any formal parameters..
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,81 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for ES6 class syntax declarations');
var constructorCallCount = 0;
const staticMethodValue = [1];
const instanceMethodValue = [2];
const getterValue = [3];
var setterValue = undefined;
class A {
constructor() { constructorCallCount++; }
static someStaticMethod() { return staticMethodValue; }
static get someStaticGetter() { return getterValue; }
static set someStaticSetter(value) { setterValue = value; }
someInstanceMethod() { return instanceMethodValue; }
get someGetter() { return getterValue; }
set someSetter(value) { setterValue = value; }
}
shouldBe("constructorCallCount", "0");
shouldBe("A.someStaticMethod()", "staticMethodValue");
shouldBe("A.someStaticGetter", "getterValue");
shouldBe("setterValue = undefined; A.someStaticSetter = 123; setterValue", "123");
shouldBe("(new A).someInstanceMethod()", "instanceMethodValue");
shouldBe("constructorCallCount", "1");
shouldBe("(new A).someGetter", "getterValue");
shouldBe("constructorCallCount", "2");
shouldBe("(new A).someGetter", "getterValue");
shouldBe("setterValue = undefined; (new A).someSetter = 789; setterValue", "789");
shouldBe("(new A).__proto__", "A.prototype");
shouldBe("A.prototype.constructor", "A");
shouldThrow("class", "'SyntaxError: Unexpected end of input'");
shouldThrow("class [", '"SyntaxError: Unexpected token \'[\'"');
shouldThrow("class {", '"SyntaxError: Unexpected token \'{\'"');
shouldThrow("class X {", "'SyntaxError: Unexpected end of input'");
shouldThrow("class X { ( }", '"SyntaxError: Unexpected token \'(\'"');
shouldNotThrow("class X {}");
shouldThrow("class X { constructor() {} constructor() {} }", "'SyntaxError: A class may only have one constructor'");
shouldThrow("class X { get constructor() {} }", "'SyntaxError: Class constructor may not be an accessor'");
shouldThrow("class X { set constructor() {} }", "'SyntaxError: Class constructor may not be an accessor'");
shouldNotThrow("class X { constructor() {} static constructor() { return staticMethodValue; } }");
shouldBe("class X { constructor() {} static constructor() { return staticMethodValue; } }; X.constructor()", "staticMethodValue");
shouldThrow("class X { constructor() {} static prototype() {} }", '"SyntaxError: Classes may not have a static property named \'prototype\'"');
shouldThrow("class X { constructor() {} static get prototype() {} }", '"SyntaxError: Classes may not have a static property named \'prototype\'"');
shouldThrow("class X { constructor() {} static set prototype() {} }", '"SyntaxError: Classes may not have a static property named \'prototype\'"');
shouldNotThrow("class X { constructor() {} prototype() { return instanceMethodValue; } }");
shouldBe("class X { constructor() {} prototype() { return instanceMethodValue; } }; (new X).prototype()", "instanceMethodValue");
shouldNotThrow("class X { constructor() {} set foo(a) {} }");
shouldNotThrow("class X { constructor() {} set foo({x, y}) {} }");
shouldThrow("class X { constructor() {} set foo() {} }");
shouldThrow("class X { constructor() {} set foo(a, b) {} }");
shouldNotThrow("class X { constructor() {} get foo() {} }");
shouldThrow("class X { constructor() {} get foo(x) {} }");
shouldThrow("class X { constructor() {} get foo({x, y}) {} }");
var successfullyParsed = true;

View File

@ -0,0 +1,18 @@
Tests for ES6 class syntax default constructor
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS new A instanceof A is true
PASS A() threw exception TypeError: Class constructor A cannot be invoked without 'new'.
PASS A.prototype.constructor instanceof Function is true
PASS A.prototype.constructor.name is "A"
PASS new B instanceof A; new B instanceof A is true
PASS B() threw exception TypeError: Class constructor B cannot be invoked without 'new'.
PASS B.prototype.constructor.name is "B"
PASS A !== B is true
PASS A.prototype.constructor !== B.prototype.constructor is true
PASS new (class extends (class { constructor(a, b) { return [a, b]; } }) {})(1, 2) is [1, 2]
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,40 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for ES6 class syntax default constructor');
class A { };
class B extends A { };
shouldBeTrue('new A instanceof A');
shouldThrow('A()', '"TypeError: Class constructor A cannot be invoked without \'new\'"');
shouldBeTrue('A.prototype.constructor instanceof Function');
shouldBe('A.prototype.constructor.name', '"A"');
shouldBeTrue('new B instanceof A; new B instanceof A');
shouldThrow('B()', '"TypeError: Class constructor B cannot be invoked without \'new\'"');
shouldBe('B.prototype.constructor.name', '"B"');
shouldBeTrue('A !== B');
shouldBeTrue('A.prototype.constructor !== B.prototype.constructor');
shouldBe('new (class extends (class { constructor(a, b) { return [a, b]; } }) {})(1, 2)', '[1, 2]');
var successfullyParsed = true;

View File

@ -0,0 +1,41 @@
Tests for ES6 class syntax expressions
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS constructorCallCount is 0
PASS A.someStaticMethod() is staticMethodValue
PASS A.someStaticGetter is getterValue
PASS setterValue = undefined; A.someStaticSetter = 123; setterValue is 123
PASS (new A).someInstanceMethod() is instanceMethodValue
PASS constructorCallCount is 1
PASS (new A).someGetter is getterValue
PASS constructorCallCount is 2
PASS (new A).someGetter is getterValue
PASS setterValue = undefined; (new A).someSetter = 789; setterValue is 789
PASS (new A).__proto__ is A.prototype
PASS A.prototype.constructor is A
PASS x = class threw exception SyntaxError: Unexpected end of input.
PASS x = class { threw exception SyntaxError: Unexpected end of input.
PASS x = class { ( } threw exception SyntaxError: Unexpected token '('.
PASS x = class {} did not throw exception.
PASS x = class { constructor() {} constructor() {} } threw exception SyntaxError: A class may only have one constructor.
PASS x = class { get constructor() {} } threw exception SyntaxError: Class constructor may not be an accessor.
PASS x = class { set constructor() {} } threw exception SyntaxError: Class constructor may not be an accessor.
PASS x = class { constructor() {} static constructor() { return staticMethodValue; } } did not throw exception.
PASS x = class { constructor() {} static constructor() { return staticMethodValue; } }; x.constructor() is staticMethodValue
PASS x = class { constructor() {} static prototype() {} } threw exception SyntaxError: Classes may not have a static property named 'prototype'.
PASS x = class { constructor() {} static get prototype() {} } threw exception SyntaxError: Classes may not have a static property named 'prototype'.
PASS x = class { constructor() {} static set prototype() {} } threw exception SyntaxError: Classes may not have a static property named 'prototype'.
PASS x = class { constructor() {} prototype() { return instanceMethodValue; } } did not throw exception.
PASS x = class { constructor() {} prototype() { return instanceMethodValue; } }; (new x).prototype() is instanceMethodValue
PASS x = class { constructor() {} set foo(a) {} } did not throw exception.
PASS x = class { constructor() {} set foo({x, y}) {} } did not throw exception.
PASS x = class { constructor() {} set foo() {} } threw exception SyntaxError: Setter must have exactly one formal parameter..
PASS x = class { constructor() {} set foo(a, b) {} } threw exception SyntaxError: Setter must have exactly one formal parameter..
PASS x = class { constructor() {} get foo() {} } did not throw exception.
PASS x = class { constructor() {} get foo(x) {} } threw exception SyntaxError: Getter must not have any formal parameters..
PASS x = class { constructor() {} get foo({x, y}) {} } threw exception SyntaxError: Getter must not have any formal parameters..
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,79 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for ES6 class syntax expressions');
var constructorCallCount = 0;
const staticMethodValue = [1];
const instanceMethodValue = [2];
const getterValue = [3];
var setterValue = undefined;
var A = class {
constructor() { constructorCallCount++; }
static someStaticMethod() { return staticMethodValue; }
static get someStaticGetter() { return getterValue; }
static set someStaticSetter(value) { setterValue = value; }
someInstanceMethod() { return instanceMethodValue; }
get someGetter() { return getterValue; }
set someSetter(value) { setterValue = value; }
};
shouldBe("constructorCallCount", "0");
shouldBe("A.someStaticMethod()", "staticMethodValue");
shouldBe("A.someStaticGetter", "getterValue");
shouldBe("setterValue = undefined; A.someStaticSetter = 123; setterValue", "123");
shouldBe("(new A).someInstanceMethod()", "instanceMethodValue");
shouldBe("constructorCallCount", "1");
shouldBe("(new A).someGetter", "getterValue");
shouldBe("constructorCallCount", "2");
shouldBe("(new A).someGetter", "getterValue");
shouldBe("setterValue = undefined; (new A).someSetter = 789; setterValue", "789");
shouldBe("(new A).__proto__", "A.prototype");
shouldBe("A.prototype.constructor", "A");
shouldThrow("x = class", "'SyntaxError: Unexpected end of input'");
shouldThrow("x = class {", "'SyntaxError: Unexpected end of input'");
shouldThrow("x = class { ( }", '"SyntaxError: Unexpected token \'(\'"');
shouldNotThrow("x = class {}");
shouldThrow("x = class { constructor() {} constructor() {} }", "'SyntaxError: A class may only have one constructor'");
shouldThrow("x = class { get constructor() {} }", "'SyntaxError: Class constructor may not be an accessor'");
shouldThrow("x = class { set constructor() {} }", "'SyntaxError: Class constructor may not be an accessor'");
shouldNotThrow("x = class { constructor() {} static constructor() { return staticMethodValue; } }");
shouldBe("x = class { constructor() {} static constructor() { return staticMethodValue; } }; x.constructor()", "staticMethodValue");
shouldThrow("x = class { constructor() {} static prototype() {} }", '"SyntaxError: Classes may not have a static property named \'prototype\'"');
shouldThrow("x = class { constructor() {} static get prototype() {} }", '"SyntaxError: Classes may not have a static property named \'prototype\'"');
shouldThrow("x = class { constructor() {} static set prototype() {} }", '"SyntaxError: Classes may not have a static property named \'prototype\'"');
shouldNotThrow("x = class { constructor() {} prototype() { return instanceMethodValue; } }");
shouldBe("x = class { constructor() {} prototype() { return instanceMethodValue; } }; (new x).prototype()", "instanceMethodValue");
shouldNotThrow("x = class { constructor() {} set foo(a) {} }");
shouldNotThrow("x = class { constructor() {} set foo({x, y}) {} }");
shouldThrow("x = class { constructor() {} set foo() {} }");
shouldThrow("x = class { constructor() {} set foo(a, b) {} }");
shouldNotThrow("x = class { constructor() {} get foo() {} }");
shouldThrow("x = class { constructor() {} get foo(x) {} }");
shouldThrow("x = class { constructor() {} get foo({x, y}) {} }");
var successfullyParsed = true;

View File

@ -0,0 +1,72 @@
Tests for ES6 class syntax "extends"
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS (new Base) instanceof Base is true
PASS Object.getPrototypeOf(new Base) is Base.prototype
PASS (new Derived) instanceof Derived is true
PASS Object.getPrototypeOf(new Derived) is Derived.prototype
PASS Object.getPrototypeOf(Derived.prototype) is Base.prototype
PASS (new Derived).baseMethod() is "base"
PASS (new Derived).overridenMethod() is "derived"
PASS Derived.staticBaseMethod() is "base"
PASS Derived.staticOverridenMethod() is "derived"
PASS x = class extends threw exception SyntaxError: Unexpected end of input.
PASS x = class extends threw exception SyntaxError: Unexpected end of input.
PASS x = class extends Base { threw exception SyntaxError: Unexpected end of input.
PASS x = class extends Base { } did not throw exception.
PASS x = class extends Base { constructor() { } } did not throw exception.
PASS x.__proto__ is Base
PASS Object.getPrototypeOf(x) is Base
PASS x.prototype.__proto__ is Base.prototype
PASS Object.getPrototypeOf(x.prototype) is Base.prototype
PASS x = class extends null { constructor() { } }; x.__proto__ is Function.prototype
PASS x.__proto__ is Function.prototype
PASS x = class extends 3 { constructor() { } }; x.__proto__ threw exception TypeError: Class extends value 3 is not a constructor or null.
PASS x = class extends "abc" { constructor() { } }; x.__proto__ threw exception TypeError: Class extends value abc is not a constructor or null.
PASS baseWithBadPrototype = function () {}; baseWithBadPrototype.prototype = 3; new baseWithBadPrototype did not throw exception.
PASS x = class extends baseWithBadPrototype { constructor() { } } threw exception TypeError: Class extends value does not have valid prototype property 3.
PASS baseWithBadPrototype.prototype = "abc" did not throw exception.
PASS x = class extends baseWithBadPrototype { constructor() { } } threw exception TypeError: Class extends value does not have valid prototype property abc.
PASS baseWithBadPrototype.prototype = null; x = class extends baseWithBadPrototype { constructor() { } } did not throw exception.
PASS x = 1; c = class extends ++x { constructor() { } }; threw exception SyntaxError: Unexpected token '++'.
PASS x = 1; c = class extends x++ { constructor() { } }; threw exception SyntaxError: Unexpected token '++'.
PASS x = 1; c = class extends (++x) { constructor() { } }; threw exception TypeError: Class extends value 2 is not a constructor or null.
PASS x = 1; c = class extends (x++) { constructor() { } }; threw exception TypeError: Class extends value 1 is not a constructor or null.
PASS x = 1; try { c = class extends (++x) { constructor() { } } } catch (e) { }; x is 2
PASS x = 1; try { c = class extends (x++) { constructor() { } } } catch (e) { }; x is 2
PASS namespace = {}; namespace.A = class { }; namespace.B = class extends namespace.A { } did not throw exception.
PASS namespace = {}; namespace.A = class A { }; namespace.B = class B extends namespace.A { } did not throw exception.
PASS namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends namespace.A { constructor() { } } did not throw exception.
PASS namespace = {}; namespace.A = class A { constructor() { } }; namespace.B = class B extends namespace.A { constructor() { } } did not throw exception.
PASS namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (namespace.A) { constructor() { } } did not throw exception.
PASS namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends namespace["A"] { constructor() { } } did not throw exception.
PASS namespace = {}; namespace.A = class { constructor() { } }; function getClassA() { return namespace.A }; namespace.B = class extends getClassA() { constructor() { } } did not throw exception.
PASS namespace = {}; namespace.A = class { constructor() { } }; function getClass(prop) { return namespace[prop] }; namespace.B = class extends getClass("A") { constructor() { } } did not throw exception.
PASS namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (false||null||namespace.A) { constructor() { } } did not throw exception.
PASS namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends false||null||namespace.A { constructor() { } } threw exception SyntaxError: Unexpected token '||'.
PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (x++, namespace.A) { constructor() { } }; did not throw exception.
PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (namespace.A, x++) { constructor() { } }; threw exception TypeError: Class extends value 1 is not a constructor or null.
PASS namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends new namespace.A { constructor() { } } threw exception TypeError: Class extends value [object Object] is not a constructor or null.
PASS namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends new namespace.A() { constructor() { } } threw exception TypeError: Class extends value [object Object] is not a constructor or null.
PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { namespace.B = class extends (x++, namespace.A) { constructor() { } } } catch (e) { } x is 2
PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { namespace.B = class extends (namespace.A, x++) { constructor() { } } } catch (e) { } x is 2
PASS Object.getPrototypeOf((class { constructor () { } }).prototype) is Object.prototype
PASS Object.getPrototypeOf((class extends null { constructor () { super(); } }).prototype) is null
PASS new (class extends undefined { constructor () { this } }) threw exception TypeError: Class extends value undefined is not a constructor or null.
PASS new (class extends undefined { constructor () { super(); } }) threw exception TypeError: Class extends value undefined is not a constructor or null.
PASS x = {}; new (class extends undefined { constructor () { return x; } }) threw exception TypeError: Class extends value undefined is not a constructor or null.
PASS y = 12; new (class extends undefined { constructor () { return y; } }) threw exception TypeError: Class extends value undefined is not a constructor or null.
PASS class x {}; new (class extends null { constructor () { return new x; } }) instanceof x is true
PASS new (class extends null { constructor () { this; } }) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS new (class extends null { constructor () { super(); } }) threw exception TypeError: Super constructor null of anonymous class is not a constructor.
PASS x = {}; new (class extends null { constructor () { return x } }) is x
PASS y = 12; new (class extends null { constructor () { return y; } }) threw exception TypeError: Derived constructors may only return object or undefined.
PASS class x {}; new (class extends null { constructor () { return new x; } }) instanceof x is true
PASS x = null; Object.getPrototypeOf((class extends x { }).prototype) is null
PASS Object.prototype.isPrototypeOf(class { }) is true
PASS Function.prototype.isPrototypeOf(class { }) is true
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,109 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for ES6 class syntax "extends"');
class Base {
constructor() { }
baseMethod() { return 'base'; }
overridenMethod() { return 'base'; }
static staticBaseMethod() { return 'base'; }
static staticOverridenMethod() { return 'base'; }
}
class Derived extends Base {
constructor() { super(); }
overridenMethod() { return 'derived'; }
static staticOverridenMethod() { return 'derived'; }
}
shouldBeTrue('(new Base) instanceof Base');
shouldBe('Object.getPrototypeOf(new Base)', 'Base.prototype');
shouldBeTrue('(new Derived) instanceof Derived');
shouldBe('Object.getPrototypeOf(new Derived)', 'Derived.prototype');
shouldBe('Object.getPrototypeOf(Derived.prototype)', 'Base.prototype');
shouldBe('(new Derived).baseMethod()', '"base"');
shouldBe('(new Derived).overridenMethod()', '"derived"');
shouldBe('Derived.staticBaseMethod()', '"base"');
shouldBe('Derived.staticOverridenMethod()', '"derived"');
shouldThrow('x = class extends', '"SyntaxError: Unexpected end of input"');
shouldThrow('x = class extends', '"SyntaxError: Unexpected end of input"');
shouldThrow('x = class extends Base {', '"SyntaxError: Unexpected end of input"');
shouldNotThrow('x = class extends Base { }');
shouldNotThrow('x = class extends Base { constructor() { } }');
shouldBe('x.__proto__', 'Base');
shouldBe('Object.getPrototypeOf(x)', 'Base');
shouldBe('x.prototype.__proto__', 'Base.prototype');
shouldBe('Object.getPrototypeOf(x.prototype)', 'Base.prototype');
shouldBe('x = class extends null { constructor() { } }; x.__proto__', 'Function.prototype');
shouldBe('x.__proto__', 'Function.prototype');
shouldThrow('x = class extends 3 { constructor() { } }; x.__proto__', '"TypeError: Class extends value 3 is not a constructor or null"');
shouldThrow('x = class extends "abc" { constructor() { } }; x.__proto__', '"TypeError: Class extends value abc is not a constructor or null"');
shouldNotThrow('baseWithBadPrototype = function () {}; baseWithBadPrototype.prototype = 3; new baseWithBadPrototype');
shouldThrow('x = class extends baseWithBadPrototype { constructor() { } }', '"TypeError: Class extends value does not have valid prototype property 3"');
shouldNotThrow('baseWithBadPrototype.prototype = "abc"');
shouldThrow('x = class extends baseWithBadPrototype { constructor() { } }', '"TypeError: Class extends value does not have valid prototype property abc"');
shouldNotThrow('baseWithBadPrototype.prototype = null; x = class extends baseWithBadPrototype { constructor() { } }');
shouldThrow('x = 1; c = class extends ++x { constructor() { } };');
shouldThrow('x = 1; c = class extends x++ { constructor() { } };');
shouldThrow('x = 1; c = class extends (++x) { constructor() { } };');
shouldThrow('x = 1; c = class extends (x++) { constructor() { } };');
shouldBe('x = 1; try { c = class extends (++x) { constructor() { } } } catch (e) { }; x', '2');
shouldBe('x = 1; try { c = class extends (x++) { constructor() { } } } catch (e) { }; x', '2');
shouldNotThrow('namespace = {}; namespace.A = class { }; namespace.B = class extends namespace.A { }');
shouldNotThrow('namespace = {}; namespace.A = class A { }; namespace.B = class B extends namespace.A { }');
shouldNotThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends namespace.A { constructor() { } }');
shouldNotThrow('namespace = {}; namespace.A = class A { constructor() { } }; namespace.B = class B extends namespace.A { constructor() { } }');
shouldNotThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (namespace.A) { constructor() { } }');
shouldNotThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends namespace["A"] { constructor() { } }');
shouldNotThrow('namespace = {}; namespace.A = class { constructor() { } }; function getClassA() { return namespace.A }; namespace.B = class extends getClassA() { constructor() { } }');
shouldNotThrow('namespace = {}; namespace.A = class { constructor() { } }; function getClass(prop) { return namespace[prop] }; namespace.B = class extends getClass("A") { constructor() { } }');
shouldNotThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (false||null||namespace.A) { constructor() { } }');
shouldThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends false||null||namespace.A { constructor() { } }');
shouldNotThrow('x = 1; namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (x++, namespace.A) { constructor() { } };');
shouldThrow('x = 1; namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends (namespace.A, x++) { constructor() { } };');
shouldThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends new namespace.A { constructor() { } }');
shouldThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends new namespace.A() { constructor() { } }');
shouldBe('x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { namespace.B = class extends (x++, namespace.A) { constructor() { } } } catch (e) { } x', '2');
shouldBe('x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { namespace.B = class extends (namespace.A, x++) { constructor() { } } } catch (e) { } x', '2');
shouldBe('Object.getPrototypeOf((class { constructor () { } }).prototype)', 'Object.prototype');
shouldBe('Object.getPrototypeOf((class extends null { constructor () { super(); } }).prototype)', 'null');
shouldThrow('new (class extends undefined { constructor () { this } })', '"TypeError: Class extends value undefined is not a constructor or null"');
shouldThrow('new (class extends undefined { constructor () { super(); } })', '"TypeError: Class extends value undefined is not a constructor or null"');
shouldThrow('x = {}; new (class extends undefined { constructor () { return x; } })', '"TypeError: Class extends value undefined is not a constructor or null"');
shouldThrow('y = 12; new (class extends undefined { constructor () { return y; } })', '"TypeError: Class extends value undefined is not a constructor or null"');
shouldBeTrue ('class x {}; new (class extends null { constructor () { return new x; } }) instanceof x');
shouldThrow('new (class extends null { constructor () { this; } })', '"ReferenceError: Must call super constructor in derived class before accessing \'this\' or returning from derived constructor"');
shouldThrow('new (class extends null { constructor () { super(); } })', '"TypeError: Super constructor null of anonymous class is not a constructor"');
shouldBe('x = {}; new (class extends null { constructor () { return x } })', 'x');
shouldThrow('y = 12; new (class extends null { constructor () { return y; } })', '"TypeError: Derived constructors may only return object or undefined"');
shouldBeTrue ('class x {}; new (class extends null { constructor () { return new x; } }) instanceof x');
shouldBe('x = null; Object.getPrototypeOf((class extends x { }).prototype)', 'null');
shouldBeTrue('Object.prototype.isPrototypeOf(class { })');
shouldBeTrue('Function.prototype.isPrototypeOf(class { })');
var successfullyParsed = true;

View File

@ -0,0 +1,125 @@
Tests for ES6 class name semantics in class statements and expressions
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Class statement
PASS A threw exception ReferenceError: A is not defined.
PASS 'use strict'; A threw exception ReferenceError: A is not defined.
PASS class {} threw exception SyntaxError: Unexpected token '{'.
PASS 'use strict'; class {} threw exception SyntaxError: Unexpected token '{'.
PASS class { constructor() {} } threw exception SyntaxError: Unexpected token '{'.
PASS 'use strict'; class { constructor() {} } threw exception SyntaxError: Unexpected token '{'.
PASS class A { constructor() {} } did not throw exception.
PASS 'use strict'; class A { constructor() {} } did not throw exception.
PASS class A { constructor() {} }; A.toString() is 'class A { constructor() {} }'
PASS 'use strict'; class A { constructor() {} }; A.toString() is 'class A { constructor() {} }'
PASS class A { constructor() {} }; (new A) instanceof A is true
PASS 'use strict'; class A { constructor() {} }; (new A) instanceof A is true
PASS class A { constructor() { this.base = A; } }; (new A).base.toString() is 'class A { constructor() { this.base = A; } }'
PASS 'use strict'; class A { constructor() { this.base = A; } }; (new A).base.toString() is 'class A { constructor() { this.base = A; } }'
PASS class A { constructor() {} }; class B extends A {}; did not throw exception.
PASS 'use strict'; class A { constructor() {} }; class B extends A {}; did not throw exception.
PASS class A { constructor() {} }; class B extends A { constructor() {} }; B.toString() is 'class B extends A { constructor() {} }'
PASS 'use strict'; class A { constructor() {} }; class B extends A { constructor() {} }; B.toString() is 'class B extends A { constructor() {} }'
PASS class A { constructor() {} }; class B extends A {}; (new B) instanceof A is true
PASS 'use strict'; class A { constructor() {} }; class B extends A {}; (new B) instanceof A is true
PASS class A { constructor() {} }; class B extends A {}; (new B) instanceof B is true
PASS 'use strict'; class A { constructor() {} }; class B extends A {}; (new B) instanceof B is true
PASS class A { constructor() {} }; class B extends A { constructor() { super(); this.base = A; this.derived = B; } }; (new B).base.toString() is 'class A { constructor() {} }'
PASS 'use strict'; class A { constructor() {} }; class B extends A { constructor() { super(); this.base = A; this.derived = B; } }; (new B).base.toString() is 'class A { constructor() {} }'
PASS class A { constructor() {} }; class B extends A { constructor() { super(); this.base = A; this.derived = B; } }; (new B).derived.toString() is 'class B extends A { constructor() { super(); this.base = A; this.derived = B; } }'
PASS 'use strict'; class A { constructor() {} }; class B extends A { constructor() { super(); this.base = A; this.derived = B; } }; (new B).derived.toString() is 'class B extends A { constructor() { super(); this.base = A; this.derived = B; } }'
Class expression
PASS A threw exception ReferenceError: A is not defined.
PASS 'use strict'; A threw exception ReferenceError: A is not defined.
PASS (class {}) did not throw exception.
PASS 'use strict'; (class {}) did not throw exception.
PASS (class { constructor(){} }) did not throw exception.
PASS 'use strict'; (class { constructor(){} }) did not throw exception.
PASS typeof (class {}) is "function"
PASS 'use strict'; typeof (class {}) is "function"
PASS (class A {}) did not throw exception.
PASS 'use strict'; (class A {}) did not throw exception.
PASS typeof (class A {}) is "function"
PASS 'use strict'; typeof (class A {}) is "function"
PASS (class A {}); A threw exception ReferenceError: A is not defined.
PASS 'use strict'; (class A {}); A threw exception ReferenceError: A is not defined.
PASS new (class A {}) did not throw exception.
PASS 'use strict'; new (class A {}) did not throw exception.
PASS typeof (new (class A {})) is "object"
PASS 'use strict'; typeof (new (class A {})) is "object"
PASS (new (class A { constructor() { this.base = A; } })).base did not throw exception.
PASS 'use strict'; (new (class A { constructor() { this.base = A; } })).base did not throw exception.
PASS (new (class A { constructor() { this.base = A; } })).base.toString() is "class A { constructor() { this.base = A; } }"
PASS 'use strict'; (new (class A { constructor() { this.base = A; } })).base.toString() is "class A { constructor() { this.base = A; } }"
PASS class A {}; (class B extends A {}) did not throw exception.
PASS 'use strict'; class A {}; (class B extends A {}) did not throw exception.
PASS class A {}; (class B extends A {}); B threw exception ReferenceError: B is not defined.
PASS 'use strict'; class A {}; (class B extends A {}); B threw exception ReferenceError: B is not defined.
PASS class A {}; new (class B extends A {}) did not throw exception.
PASS 'use strict'; class A {}; new (class B extends A {}) did not throw exception.
PASS class A {}; new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } }) did not throw exception.
PASS 'use strict'; class A {}; new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } }) did not throw exception.
PASS class A {}; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })) instanceof A is true
PASS 'use strict'; class A {}; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })) instanceof A is true
PASS class A { constructor() {} }; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })).base.toString() is 'class A { constructor() {} }'
PASS 'use strict'; class A { constructor() {} }; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })).base.toString() is 'class A { constructor() {} }'
PASS class A { constructor() {} }; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })).derived.toString() is 'class B extends A { constructor() { super(); this.base = A; this.derived = B; } }'
PASS 'use strict'; class A { constructor() {} }; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })).derived.toString() is 'class B extends A { constructor() { super(); this.base = A; this.derived = B; } }'
Class expression assignment to variable
PASS A threw exception ReferenceError: A is not defined.
PASS 'use strict'; A threw exception ReferenceError: A is not defined.
PASS var VarA = class {} did not throw exception.
PASS 'use strict'; var VarA = class {} did not throw exception.
PASS var VarA = class { constructor() {} }; VarA.toString() is 'class { constructor() {} }'
PASS 'use strict'; var VarA = class { constructor() {} }; VarA.toString() is 'class { constructor() {} }'
PASS VarA threw exception ReferenceError: VarA is not defined.
PASS 'use strict'; VarA threw exception ReferenceError: VarA is not defined.
PASS var VarA = class A { constructor() {} } did not throw exception.
PASS 'use strict'; var VarA = class A { constructor() {} } did not throw exception.
PASS var VarA = class A { constructor() {} }; VarA.toString() is 'class A { constructor() {} }'
PASS 'use strict'; var VarA = class A { constructor() {} }; VarA.toString() is 'class A { constructor() {} }'
PASS var VarA = class A { constructor() {} }; A.toString() threw exception ReferenceError: A is not defined.
PASS 'use strict'; var VarA = class A { constructor() {} }; A.toString() threw exception ReferenceError: A is not defined.
PASS var VarA = class A { constructor() {} }; (new VarA) instanceof VarA is true
PASS 'use strict'; var VarA = class A { constructor() {} }; (new VarA) instanceof VarA is true
PASS var VarA = class A { constructor() { this.base = A; } }; (new VarA).base.toString() is 'class A { constructor() { this.base = A; } }'
PASS 'use strict'; var VarA = class A { constructor() { this.base = A; } }; (new VarA).base.toString() is 'class A { constructor() { this.base = A; } }'
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; did not throw exception.
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; did not throw exception.
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; B threw exception ReferenceError: B is not defined.
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; B threw exception ReferenceError: B is not defined.
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; VarB.toString() is 'class B extends VarA { constructor() {} }'
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; VarB.toString() is 'class B extends VarA { constructor() {} }'
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { }; (new VarB) instanceof VarA is true
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { }; (new VarB) instanceof VarA is true
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { }; (new VarB) instanceof VarB is true
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { }; (new VarB) instanceof VarB is true
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).base === VarA is true
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).base === VarA is true
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).derived === VarB is true
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).derived === VarB is true
PASS var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).derivedVar === VarB is true
PASS 'use strict'; var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).derivedVar === VarB is true
Class statement binding in other circumstances
PASS var result = A; result threw exception ReferenceError: A is not defined.
PASS 'use strict'; var result = A; result threw exception ReferenceError: A is not defined.
PASS var result = A; class A {}; result threw exception ReferenceError: Cannot access 'A' before initialization.
PASS 'use strict'; var result = A; class A {}; result threw exception ReferenceError: Cannot access 'A' before initialization.
PASS class A { constructor() { A = 1; } }; new A threw exception TypeError: Assignment to constant variable..
PASS 'use strict'; class A { constructor() { A = 1; } }; new A threw exception TypeError: Assignment to constant variable..
PASS class A { constructor() { } }; A = 1; A is 1
PASS 'use strict'; class A { constructor() { } }; A = 1; A is 1
PASS class A {}; var result = A; result did not throw exception.
PASS 'use strict'; class A {}; var result = A; result did not throw exception.
PASS eval('var Foo = 10'); Foo is 10
PASS 'use strict'; eval('var Foo = 10'); Foo threw exception ReferenceError: Foo is not defined.
PASS eval('class Bar { constructor() {} }; Bar.toString()') is 'class Bar { constructor() {} }'
PASS 'use strict'; eval('class Bar { constructor() {} }'); Bar.toString() threw exception ReferenceError: Bar is not defined.
PASS successfullyParsed is true
TEST COMPLETE

113
deps/v8/test/webkit/class-syntax-name.js vendored Normal file
View File

@ -0,0 +1,113 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for ES6 class name semantics in class statements and expressions');
function runTestShouldBe(statement, result) {
shouldBe(statement, result);
shouldBe("'use strict'; " + statement, result);
}
function runTestShouldBeTrue(statement) {
shouldBeTrue(statement);
shouldBeTrue("'use strict'; " + statement);
}
function runTestShouldThrow(statement) {
shouldThrow(statement);
shouldThrow("'use strict'; " + statement);
}
function runTestShouldNotThrow(statement) {
shouldNotThrow(statement);
shouldNotThrow("'use strict'; " + statement);
}
// Class statement. Class name added to global scope. Class name is available inside class scope and in global scope.
debug('Class statement');
runTestShouldThrow("A");
runTestShouldThrow("class {}");
runTestShouldThrow("class { constructor() {} }");
runTestShouldNotThrow("class A { constructor() {} }");
runTestShouldBe("class A { constructor() {} }; A.toString()", "'class A { constructor() {} }'");
runTestShouldBeTrue("class A { constructor() {} }; (new A) instanceof A");
runTestShouldBe("class A { constructor() { this.base = A; } }; (new A).base.toString()", "'class A { constructor() { this.base = A; } }'");
runTestShouldNotThrow("class A { constructor() {} }; class B extends A {};");
runTestShouldBe("class A { constructor() {} }; class B extends A { constructor() {} }; B.toString()", "'class B extends A { constructor() {} }'");
runTestShouldBeTrue("class A { constructor() {} }; class B extends A {}; (new B) instanceof A");
runTestShouldBeTrue("class A { constructor() {} }; class B extends A {}; (new B) instanceof B");
runTestShouldBe("class A { constructor() {} }; class B extends A { constructor() { super(); this.base = A; this.derived = B; } }; (new B).base.toString()", "'class A { constructor() {} }'");
runTestShouldBe("class A { constructor() {} }; class B extends A { constructor() { super(); this.base = A; this.derived = B; } }; (new B).derived.toString()", "'class B extends A { constructor() { super(); this.base = A; this.derived = B; } }'");
// Class expression. Class name not added to scope. Class name is available inside class scope.
debug(''); debug('Class expression');
runTestShouldThrow("A");
runTestShouldNotThrow("(class {})");
runTestShouldNotThrow("(class { constructor(){} })");
runTestShouldBe("typeof (class {})", '"function"');
runTestShouldNotThrow("(class A {})");
runTestShouldBe("typeof (class A {})", '"function"');
runTestShouldThrow("(class A {}); A");
runTestShouldNotThrow("new (class A {})");
runTestShouldBe("typeof (new (class A {}))", '"object"');
runTestShouldNotThrow("(new (class A { constructor() { this.base = A; } })).base");
runTestShouldBe("(new (class A { constructor() { this.base = A; } })).base.toString()", '"class A { constructor() { this.base = A; } }"');
runTestShouldNotThrow("class A {}; (class B extends A {})");
runTestShouldThrow("class A {}; (class B extends A {}); B");
runTestShouldNotThrow("class A {}; new (class B extends A {})");
runTestShouldNotThrow("class A {}; new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })");
runTestShouldBeTrue("class A {}; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })) instanceof A");
runTestShouldBe("class A { constructor() {} }; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })).base.toString()", "'class A { constructor() {} }'");
runTestShouldBe("class A { constructor() {} }; (new (class B extends A { constructor() { super(); this.base = A; this.derived = B; } })).derived.toString()", "'class B extends A { constructor() { super(); this.base = A; this.derived = B; } }'");
// Assignment of a class expression to a variable. Variable name available in scope, class name is not. Class name is available inside class scope.
debug(''); debug('Class expression assignment to variable');
runTestShouldThrow("A");
runTestShouldNotThrow("var VarA = class {}");
runTestShouldBe("var VarA = class { constructor() {} }; VarA.toString()", "'class { constructor() {} }'");
runTestShouldThrow("VarA");
runTestShouldNotThrow("var VarA = class A { constructor() {} }");
runTestShouldBe("var VarA = class A { constructor() {} }; VarA.toString()", "'class A { constructor() {} }'");
runTestShouldThrow("var VarA = class A { constructor() {} }; A.toString()");
runTestShouldBeTrue("var VarA = class A { constructor() {} }; (new VarA) instanceof VarA");
runTestShouldBe("var VarA = class A { constructor() { this.base = A; } }; (new VarA).base.toString()", "'class A { constructor() { this.base = A; } }'");
runTestShouldNotThrow("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} };");
runTestShouldThrow("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; B");
runTestShouldBe("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() {} }; VarB.toString()", "'class B extends VarA { constructor() {} }'");
runTestShouldBeTrue("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { }; (new VarB) instanceof VarA");
runTestShouldBeTrue("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { }; (new VarB) instanceof VarB");
runTestShouldBeTrue("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).base === VarA");
runTestShouldBeTrue("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).derived === VarB");
runTestShouldBeTrue("var VarA = class A { constructor() {} }; var VarB = class B extends VarA { constructor() { super(); this.base = VarA; this.derived = B; this.derivedVar = VarB; } }; (new VarB).derivedVar === VarB");
// FIXME: Class statement binding should be like `let`, not `var`.
debug(''); debug('Class statement binding in other circumstances');
runTestShouldThrow("var result = A; result");
runTestShouldThrow("var result = A; class A {}; result");
runTestShouldThrow("class A { constructor() { A = 1; } }; new A");
runTestShouldBe("class A { constructor() { } }; A = 1; A", "1");
runTestShouldNotThrow("class A {}; var result = A; result");
shouldBe("eval('var Foo = 10'); Foo", "10");
shouldThrow("'use strict'; eval('var Foo = 10'); Foo");
shouldBe("eval('class Bar { constructor() {} }; Bar.toString()')", "'class Bar { constructor() {} }'");
shouldThrow("'use strict'; eval('class Bar { constructor() {} }'); Bar.toString()");

View File

@ -0,0 +1,50 @@
Tests for the descriptors of the properties implicitly defined by ES6 class syntax
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS class A {}; descriptor(A, "prototype").writable is false
PASS class A {}; var x = A.prototype; A.prototype = 3; A.prototype is x
PASS class A {}; descriptor(A, "prototype").enumerable is false
PASS class A {}; A.foo = "foo"; enumeratedProperties(A).includes("foo") is true
PASS class A {}; enumeratedProperties(A).includes("prototype") is false
PASS class A {}; descriptor(A, "prototype").configurable is false
PASS class A {}; Object.defineProperty(A, "prototype", {value: "foo"}) threw exception TypeError: Cannot redefine property: prototype.
PASS class A { static foo() {} }; descriptor(A, "foo").writable is true
PASS class A { static foo() {} }; A.foo = 3; A.foo is 3
PASS class A { static foo() {} }; descriptor(A, "foo").enumerable is false
PASS class A { static foo() {} }; enumeratedProperties(A).includes("foo") is false
PASS class A { static foo() {} }; descriptor(A, "foo").configurable is true
PASS class A { static foo() {} }; Object.defineProperty(A, "foo", {value: "bar"}); A.foo is "bar"
PASS class A { static get foo() {} }; descriptor(A, "foo").writable is undefined
PASS class A { static get foo() { return 5; } }; A.foo = 3; A.foo is 5
PASS class A { static get foo() {} }; descriptor(A, "foo").enumerable is false
PASS class A { static get foo() {} }; enumeratedProperties(A).includes("foo") is false
PASS class A { static get foo() {} }; enumeratedProperties(new A).includes("foo") is false
PASS class A { static get foo() {} }; descriptor(A, "foo").configurable is true
PASS class A { static get foo() {} }; Object.defineProperty(A, "foo", {value: "bar"}); A.foo is "bar"
PASS class A { foo() {} }; descriptor(A.prototype, "foo").writable is true
PASS class A { foo() {} }; A.prototype.foo = 3; A.prototype.foo is 3
PASS class A { foo() {} }; descriptor(A.prototype, "foo").enumerable is false
PASS class A { foo() {} }; enumeratedProperties(A.prototype).includes("foo") is false
PASS class A { foo() {} }; enumeratedProperties(new A).includes("foo") is false
PASS class A { foo() {} }; descriptor(A.prototype, "foo").configurable is true
PASS class A { foo() {} }; Object.defineProperty(A.prototype, "foo", {value: "bar"}); A.prototype.foo is "bar"
PASS class A { get foo() {} }; descriptor(A.prototype, "foo").writable is undefined
PASS class A { get foo() { return 5; } }; A.prototype.foo = 3; A.prototype.foo is 5
PASS class A { get foo() {} }; descriptor(A.prototype, "foo").enumerable is false
PASS class A { get foo() {} }; enumeratedProperties(A.prototype).includes("foo") is false
PASS class A { get foo() {} }; enumeratedProperties(new A).includes("foo") is false
PASS class A { get foo() {} }; descriptor(A.prototype, "foo").configurable is true
PASS class A { get foo() {} }; Object.defineProperty(A.prototype, "foo", {value: "bar"}); A.prototype.foo is "bar"
PASS class A { }; descriptor(A.prototype, "constructor").writable is true
PASS class A { }; A.prototype.constructor = 3; A.prototype.constructor is 3
PASS class A { }; x = {}; A.prototype.constructor = function () { return x; }; (new A) instanceof A is true
PASS class A { }; descriptor(A.prototype, "constructor").enumerable is false
PASS class A { }; enumeratedProperties(A.prototype).includes("constructor") is false
PASS class A { }; enumeratedProperties(new A).includes("constructor") is false
PASS class A { }; descriptor(A.prototype, "constructor").configurable is true
PASS class A { }; Object.defineProperty(A.prototype, "constructor", {value: "bar"}); A.prototype.constructor is "bar"
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,89 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for the descriptors of the properties implicitly defined by ES6 class syntax');
function descriptor(object, propertyName) {
return Object.getOwnPropertyDescriptor(object, propertyName);
}
function enumeratedProperties(object) {
var properties = [];
for (var propertyName in object)
properties.push(propertyName);
return properties;
}
Array.prototype.includes = function(element) {
return this.indexOf(element) !== -1;
};
shouldBeFalse('class A {}; descriptor(A, "prototype").writable');
shouldBe('class A {}; var x = A.prototype; A.prototype = 3; A.prototype', 'x');
shouldBeFalse('class A {}; descriptor(A, "prototype").enumerable');
shouldBeTrue('class A {}; A.foo = "foo"; enumeratedProperties(A).includes("foo")');
shouldBeFalse('class A {}; enumeratedProperties(A).includes("prototype")');
shouldBeFalse('class A {}; descriptor(A, "prototype").configurable');
shouldThrow('class A {}; Object.defineProperty(A, "prototype", {value: "foo"})', '"TypeError: Cannot redefine property: prototype"');
shouldBeTrue('class A { static foo() {} }; descriptor(A, "foo").writable');
shouldBe('class A { static foo() {} }; A.foo = 3; A.foo', '3');
shouldBeFalse('class A { static foo() {} }; descriptor(A, "foo").enumerable');
shouldBeFalse('class A { static foo() {} }; enumeratedProperties(A).includes("foo")');
shouldBeTrue('class A { static foo() {} }; descriptor(A, "foo").configurable');
shouldBe('class A { static foo() {} }; Object.defineProperty(A, "foo", {value: "bar"}); A.foo', '"bar"');
shouldBe('class A { static get foo() {} }; descriptor(A, "foo").writable', 'undefined');
shouldBe('class A { static get foo() { return 5; } }; A.foo = 3; A.foo', '5');
shouldBeFalse('class A { static get foo() {} }; descriptor(A, "foo").enumerable');
shouldBeFalse('class A { static get foo() {} }; enumeratedProperties(A).includes("foo")');
shouldBeFalse('class A { static get foo() {} }; enumeratedProperties(new A).includes("foo")');
shouldBeTrue('class A { static get foo() {} }; descriptor(A, "foo").configurable');
shouldBe('class A { static get foo() {} }; Object.defineProperty(A, "foo", {value: "bar"}); A.foo', '"bar"');
shouldBeTrue('class A { foo() {} }; descriptor(A.prototype, "foo").writable');
shouldBe('class A { foo() {} }; A.prototype.foo = 3; A.prototype.foo', '3');
shouldBeFalse('class A { foo() {} }; descriptor(A.prototype, "foo").enumerable');
shouldBeFalse('class A { foo() {} }; enumeratedProperties(A.prototype).includes("foo")');
shouldBeFalse('class A { foo() {} }; enumeratedProperties(new A).includes("foo")');
shouldBeTrue('class A { foo() {} }; descriptor(A.prototype, "foo").configurable');
shouldBe('class A { foo() {} }; Object.defineProperty(A.prototype, "foo", {value: "bar"}); A.prototype.foo', '"bar"');
shouldBe('class A { get foo() {} }; descriptor(A.prototype, "foo").writable', 'undefined');
shouldBe('class A { get foo() { return 5; } }; A.prototype.foo = 3; A.prototype.foo', '5');
shouldBeFalse('class A { get foo() {} }; descriptor(A.prototype, "foo").enumerable');
shouldBeFalse('class A { get foo() {} }; enumeratedProperties(A.prototype).includes("foo")');
shouldBeFalse('class A { get foo() {} }; enumeratedProperties(new A).includes("foo")');
shouldBeTrue('class A { get foo() {} }; descriptor(A.prototype, "foo").configurable');
shouldBe('class A { get foo() {} }; Object.defineProperty(A.prototype, "foo", {value: "bar"}); A.prototype.foo', '"bar"');
shouldBeTrue('class A { }; descriptor(A.prototype, "constructor").writable');
shouldBe('class A { }; A.prototype.constructor = 3; A.prototype.constructor', '3');
shouldBeTrue('class A { }; x = {}; A.prototype.constructor = function () { return x; }; (new A) instanceof A');
shouldBeFalse('class A { }; descriptor(A.prototype, "constructor").enumerable');
shouldBeFalse('class A { }; enumeratedProperties(A.prototype).includes("constructor")');
shouldBeFalse('class A { }; enumeratedProperties(new A).includes("constructor")');
shouldBeTrue('class A { }; descriptor(A.prototype, "constructor").configurable');
shouldBe('class A { }; Object.defineProperty(A.prototype, "constructor", {value: "bar"}); A.prototype.constructor', '"bar"');
var successfullyParsed = true;

View File

@ -0,0 +1,10 @@
Tests for scoping of variables in ES6 class syntax
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS test() is "PASS"
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,37 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for scoping of variables in ES6 class syntax');
var local = "FAIL";
function test() {
var local = "PASS";
class A {
getLocal(x) { return local; }
};
return new A().getLocal();
}
shouldBe('test()', '"PASS"');
var successfullyParsed = true;

View File

@ -0,0 +1,62 @@
Tests for ES6 class syntax containing semicolon in the class body
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS class A { foo() ; { } } threw exception SyntaxError: Unexpected token ';'.
PASS class A { get foo;() { } } threw exception SyntaxError: Unexpected token ';'.
PASS class A { get foo() ; { } } threw exception SyntaxError: Unexpected token ';'.
PASS class A { set foo;(x) { } } threw exception SyntaxError: Unexpected token ';'.
PASS class A { set foo(x) ; { } } threw exception SyntaxError: Unexpected token ';'.
PASS class A { ; } did not throw exception.
PASS class A { foo() { } ; } did not throw exception.
PASS class A { get foo() { } ; } did not throw exception.
PASS class A { set foo(x) { } ; } did not throw exception.
PASS class A { static foo() { } ; } did not throw exception.
PASS class A { static get foo() { } ; } did not throw exception.
PASS class A { static set foo(x) { } ; } did not throw exception.
PASS class A { ; foo() { } } did not throw exception.
PASS class A { ; get foo() { } } did not throw exception.
PASS class A { ; set foo(x) { } } did not throw exception.
PASS class A { ; static foo() { } } did not throw exception.
PASS class A { ; static get foo() { } } did not throw exception.
PASS class A { ; static set foo(x) { } } did not throw exception.
PASS class A { foo() { } ; foo() {} } did not throw exception.
PASS class A { foo() { } ; get foo() {} } did not throw exception.
PASS class A { foo() { } ; set foo(x) {} } did not throw exception.
PASS class A { foo() { } ; static foo() {} } did not throw exception.
PASS class A { foo() { } ; static get foo() {} } did not throw exception.
PASS class A { foo() { } ; static set foo(x) {} } did not throw exception.
PASS class A { get foo() { } ; foo() {} } did not throw exception.
PASS class A { get foo() { } ; get foo() {} } did not throw exception.
PASS class A { get foo() { } ; set foo(x) {} } did not throw exception.
PASS class A { get foo() { } ; static foo() {} } did not throw exception.
PASS class A { get foo() { } ; static get foo() {} } did not throw exception.
PASS class A { get foo() { } ; static set foo(x) {} } did not throw exception.
PASS class A { set foo(x) { } ; foo() {} } did not throw exception.
PASS class A { set foo(x) { } ; get foo() {} } did not throw exception.
PASS class A { set foo(x) { } ; set foo(x) {} } did not throw exception.
PASS class A { set foo(x) { } ; static foo() {} } did not throw exception.
PASS class A { set foo(x) { } ; static get foo() {} } did not throw exception.
PASS class A { set foo(x) { } ; static set foo(x) {} } did not throw exception.
PASS class A { static foo() { } ; foo() {} } did not throw exception.
PASS class A { static foo() { } ; get foo() {} } did not throw exception.
PASS class A { static foo() { } ; set foo(x) {} } did not throw exception.
PASS class A { static foo() { } ; static foo() {} } did not throw exception.
PASS class A { static foo() { } ; static get foo() {} } did not throw exception.
PASS class A { static foo() { } ; static set foo(x) {} } did not throw exception.
PASS class A { static get foo() { } ; foo() {} } did not throw exception.
PASS class A { static get foo() { } ; get foo() {} } did not throw exception.
PASS class A { static get foo() { } ; set foo(x) {} } did not throw exception.
PASS class A { static get foo() { } ; static foo() {} } did not throw exception.
PASS class A { static get foo() { } ; static get foo() {} } did not throw exception.
PASS class A { static get foo() { } ; static set foo(x) {} } did not throw exception.
PASS class A { static set foo(x) { } ; foo() {} } did not throw exception.
PASS class A { static set foo(x) { } ; get foo() {} } did not throw exception.
PASS class A { static set foo(x) { } ; set foo(x) {} } did not throw exception.
PASS class A { static set foo(x) { } ; static foo() {} } did not throw exception.
PASS class A { static set foo(x) { } ; static get foo() {} } did not throw exception.
PASS class A { static set foo(x) { } ; static set foo(x) {} } did not throw exception.
PASS successfullyParsed is true
TEST COMPLETE

View File

@ -0,0 +1,89 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description('Tests for ES6 class syntax containing semicolon in the class body');
shouldThrow("class A { foo() ; { } }", '"SyntaxError: Unexpected token \';\'"');
shouldThrow("class A { get foo;() { } }", '"SyntaxError: Unexpected token \';\'"');
shouldThrow("class A { get foo() ; { } }", '"SyntaxError: Unexpected token \';\'"');
shouldThrow("class A { set foo;(x) { } }", '"SyntaxError: Unexpected token \';\'"');
shouldThrow("class A { set foo(x) ; { } }", '"SyntaxError: Unexpected token \';\'"');
shouldNotThrow("class A { ; }");
shouldNotThrow("class A { foo() { } ; }");
shouldNotThrow("class A { get foo() { } ; }");
shouldNotThrow("class A { set foo(x) { } ; }");
shouldNotThrow("class A { static foo() { } ; }");
shouldNotThrow("class A { static get foo() { } ; }");
shouldNotThrow("class A { static set foo(x) { } ; }");
shouldNotThrow("class A { ; foo() { } }");
shouldNotThrow("class A { ; get foo() { } }");
shouldNotThrow("class A { ; set foo(x) { } }");
shouldNotThrow("class A { ; static foo() { } }");
shouldNotThrow("class A { ; static get foo() { } }");
shouldNotThrow("class A { ; static set foo(x) { } }");
shouldNotThrow("class A { foo() { } ; foo() {} }");
shouldNotThrow("class A { foo() { } ; get foo() {} }");
shouldNotThrow("class A { foo() { } ; set foo(x) {} }");
shouldNotThrow("class A { foo() { } ; static foo() {} }");
shouldNotThrow("class A { foo() { } ; static get foo() {} }");
shouldNotThrow("class A { foo() { } ; static set foo(x) {} }");
shouldNotThrow("class A { get foo() { } ; foo() {} }");
shouldNotThrow("class A { get foo() { } ; get foo() {} }");
shouldNotThrow("class A { get foo() { } ; set foo(x) {} }");
shouldNotThrow("class A { get foo() { } ; static foo() {} }");
shouldNotThrow("class A { get foo() { } ; static get foo() {} }");
shouldNotThrow("class A { get foo() { } ; static set foo(x) {} }");
shouldNotThrow("class A { set foo(x) { } ; foo() {} }");
shouldNotThrow("class A { set foo(x) { } ; get foo() {} }");
shouldNotThrow("class A { set foo(x) { } ; set foo(x) {} }");
shouldNotThrow("class A { set foo(x) { } ; static foo() {} }");
shouldNotThrow("class A { set foo(x) { } ; static get foo() {} }");
shouldNotThrow("class A { set foo(x) { } ; static set foo(x) {} }");
shouldNotThrow("class A { static foo() { } ; foo() {} }");
shouldNotThrow("class A { static foo() { } ; get foo() {} }");
shouldNotThrow("class A { static foo() { } ; set foo(x) {} }");
shouldNotThrow("class A { static foo() { } ; static foo() {} }");
shouldNotThrow("class A { static foo() { } ; static get foo() {} }");
shouldNotThrow("class A { static foo() { } ; static set foo(x) {} }");
shouldNotThrow("class A { static get foo() { } ; foo() {} }");
shouldNotThrow("class A { static get foo() { } ; get foo() {} }");
shouldNotThrow("class A { static get foo() { } ; set foo(x) {} }");
shouldNotThrow("class A { static get foo() { } ; static foo() {} }");
shouldNotThrow("class A { static get foo() { } ; static get foo() {} }");
shouldNotThrow("class A { static get foo() { } ; static set foo(x) {} }");
shouldNotThrow("class A { static set foo(x) { } ; foo() {} }");
shouldNotThrow("class A { static set foo(x) { } ; get foo() {} }");
shouldNotThrow("class A { static set foo(x) { } ; set foo(x) {} }");
shouldNotThrow("class A { static set foo(x) { } ; static foo() {} }");
shouldNotThrow("class A { static set foo(x) { } ; static get foo() {} }");
shouldNotThrow("class A { static set foo(x) { } ; static set foo(x) {} }");
var successfullyParsed = true;

View File

@ -0,0 +1,46 @@
Tests for ES6 class syntax "super"
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS (new Base) instanceof Base is true
PASS (new Derived) instanceof Derived is true
PASS (new Derived).callBaseMethod() is baseMethodValue
PASS x = (new Derived).callBaseMethod; x() is baseMethodValue
PASS (new Derived).callBaseMethodInGetter is baseMethodValue
PASS (new Derived).callBaseMethodInSetter = 1; valueInSetter is baseMethodValue
PASS (new Derived).baseMethodInGetterSetter is (new Base).baseMethod
PASS (new Derived).baseMethodInGetterSetter = 1; valueInSetter is (new Base).baseMethod
PASS Derived.staticMethod() is "base3"
PASS (new SecondDerived).chainMethod() is ["base", "derived", "secondDerived"]
PASS x = class extends Base { constructor() { super(); } super() {} } did not throw exception.
PASS x = class extends Base { constructor() { super(); } method() { super() } } threw exception SyntaxError: 'super' keyword unexpected here.
PASS x = class extends Base { constructor() { super(); } method() { super } } threw exception SyntaxError: 'super' keyword unexpected here.
PASS x = class extends Base { constructor() { super(); } method() { return new super } } threw exception SyntaxError: 'super' keyword unexpected here.
PASS x = class extends Base { constructor() { super(); } method1() { delete (super.foo) } method2() { delete super["foo"] } } did not throw exception.
PASS (new x).method1() threw exception ReferenceError: Unsupported reference to 'super'.
PASS (new x).method2() threw exception ReferenceError: Unsupported reference to 'super'.
PASS new (class { constructor() { return undefined; } }) instanceof Object is true
PASS new (class { constructor() { return 1; } }) instanceof Object is true
PASS new (class extends Base { constructor() { return undefined } }) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS new (class extends Base { constructor() { super(); return undefined } }) instanceof Object is true
PASS x = { }; new (class extends Base { constructor() { return x } }); is x
PASS x instanceof Base is false
PASS new (class extends Base { constructor() { } }) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS new (class extends Base { constructor() { return 1; } }) threw exception TypeError: Derived constructors may only return object or undefined.
PASS new (class extends null { constructor() { return undefined } }) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS new (class extends null { constructor() { super(); return undefined } }) threw exception TypeError: Super constructor null of anonymous class is not a constructor.
PASS x = { }; new (class extends null { constructor() { return x } }); is x
PASS x instanceof Object is true
PASS new (class extends null { constructor() { } }) threw exception ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor.
PASS new (class extends null { constructor() { return 1; } }) threw exception TypeError: Derived constructors may only return object or undefined.
PASS new (class extends null { constructor() { super() } }) threw exception TypeError: Super constructor null of anonymous class is not a constructor.
PASS new (class { constructor() { super() } }) threw exception SyntaxError: 'super' keyword unexpected here.
PASS function x() { super(); } threw exception SyntaxError: 'super' keyword unexpected here.
PASS new (class extends Object { constructor() { function x() { super() } } }) threw exception SyntaxError: 'super' keyword unexpected here.
PASS new (class extends Object { constructor() { function x() { super.method } } }) threw exception SyntaxError: 'super' keyword unexpected here.
PASS function x() { super.method(); } threw exception SyntaxError: 'super' keyword unexpected here.
PASS function x() { super(); } threw exception SyntaxError: 'super' keyword unexpected here.
PASS successfullyParsed is true
TEST COMPLETE

Some files were not shown because too many files have changed in this diff Show More