diff options
author | Steve Block <steveblock@google.com> | 2011-05-12 15:51:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-12 16:12:25 +0100 |
commit | 9fac840a46e8b7e26894f4792ba26dde14c56b04 (patch) | |
tree | 0b8b71befb5175abac552daa0d084fc51c1090b8 /test | |
parent | b0fe1620dcb4135ac3ab2d66ff93072373911299 (diff) | |
download | v8-9fac840a46e8b7e26894f4792ba26dde14c56b04.tar.gz |
Update V8 to r6190 as required by WebKit r75315
Change-Id: I0b2f598e4d8748df417ad350fc47a1c465ad1fef
Diffstat (limited to 'test')
-rw-r--r-- | test/cctest/test-assembler-ia32.cc | 10 | ||||
-rw-r--r-- | test/cctest/test-disasm-ia32.cc | 2 | ||||
-rwxr-xr-x | test/cctest/test-parsing.cc | 2 | ||||
-rw-r--r-- | test/mjsunit/bugs/bug-1015.js | 66 | ||||
-rw-r--r-- | test/mjsunit/indexed-accessors.js | 13 | ||||
-rw-r--r-- | test/mjsunit/regress/regress-1017.js | 36 | ||||
-rw-r--r-- | test/mjsunit/regress/regress-900.js | 46 | ||||
-rw-r--r-- | test/mozilla/mozilla.status | 2 |
8 files changed, 155 insertions, 22 deletions
diff --git a/test/cctest/test-assembler-ia32.cc b/test/cctest/test-assembler-ia32.cc index 40232ef5..14692ff1 100644 --- a/test/cctest/test-assembler-ia32.cc +++ b/test/cctest/test-assembler-ia32.cc @@ -74,7 +74,7 @@ TEST(AssemblerIa320) { Handle<Object>(Heap::undefined_value()))-> ToObjectChecked(); CHECK(code->IsCode()); -#ifdef DEBUG +#ifdef OBJECT_PRINT Code::cast(code)->Print(); #endif F2 f = FUNCTION_CAST<F2>(Code::cast(code)->entry()); @@ -112,7 +112,7 @@ TEST(AssemblerIa321) { Handle<Object>(Heap::undefined_value()))-> ToObjectChecked(); CHECK(code->IsCode()); -#ifdef DEBUG +#ifdef OBJECT_PRINT Code::cast(code)->Print(); #endif F1 f = FUNCTION_CAST<F1>(Code::cast(code)->entry()); @@ -155,7 +155,7 @@ TEST(AssemblerIa322) { Handle<Object>(Heap::undefined_value()))->ToObjectChecked(); CHECK(code->IsCode()); -#ifdef DEBUG +#ifdef OBJECT_PRINT Code::cast(code)->Print(); #endif F1 f = FUNCTION_CAST<F1>(Code::cast(code)->entry()); @@ -329,7 +329,7 @@ TEST(AssemblerIa328) { Code::ComputeFlags(Code::STUB), Handle<Object>(Heap::undefined_value()))->ToObjectChecked()); CHECK(code->IsCode()); -#ifdef DEBUG +#ifdef OBJECT_PRINT Code::cast(code)->Print(); #endif F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry()); @@ -384,7 +384,7 @@ TEST(AssemblerIa329) { Code::ComputeFlags(Code::STUB), Handle<Object>(Heap::undefined_value()))->ToObjectChecked()); CHECK(code->IsCode()); -#ifdef DEBUG +#ifdef OBJECT_PRINT Code::cast(code)->Print(); #endif diff --git a/test/cctest/test-disasm-ia32.cc b/test/cctest/test-disasm-ia32.cc index 5cd56acf..b563f8fc 100644 --- a/test/cctest/test-disasm-ia32.cc +++ b/test/cctest/test-disasm-ia32.cc @@ -443,7 +443,7 @@ TEST(DisasmIa320) { Code::ComputeFlags(Code::STUB), Handle<Object>(Heap::undefined_value()))->ToObjectChecked(); CHECK(code->IsCode()); -#ifdef DEBUG +#ifdef OBJECT_PRINT Code::cast(code)->Print(); byte* begin = Code::cast(code)->instruction_start(); byte* end = begin + Code::cast(code)->instruction_size(); diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc index e642d1b6..da5d771d 100755 --- a/test/cctest/test-parsing.cc +++ b/test/cctest/test-parsing.cc @@ -573,7 +573,7 @@ void TestStreamScanner(i::UC16CharacterStream* stream, int skip_pos = 0, // Zero means not skipping. int skip_to = 0) { i::V8JavaScriptScanner scanner; - scanner.Initialize(stream, i::JavaScriptScanner::kAllLiterals); + scanner.Initialize(stream); int i = 0; do { diff --git a/test/mjsunit/bugs/bug-1015.js b/test/mjsunit/bugs/bug-1015.js new file mode 100644 index 00000000..9e4406a9 --- /dev/null +++ b/test/mjsunit/bugs/bug-1015.js @@ -0,0 +1,66 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT +// OWNER OR 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. + +// See: http://code.google.com/p/v8/issues/detail?id=1015 + +// Object and array literals should be created using DefineOwnProperty, and +// therefore not hit setters in the prototype. + +function mkFail(message) { + return function () { assertUnreachable(message); } +} + +Object.defineProperty(Object.prototype, "foo", + {get: mkFail("oget"), set: mkFail("oset")}); +Object.defineProperty(Array.prototype, "2", + {get: mkFail("aget"), set: mkFail("aset")}); + +function inFunction() { + for (var i = 0; i < 10; i++) { + // in loop. + var ja = JSON.parse('[1,2,3,4]'); + var jo = JSON.parse('{"bar": 10, "foo": 20}') + var jop = JSON.parse('{"bar": 10, "__proto__": { }, "foo": 20}') + var a = [1,2,3,4]; + var o = { bar: 10, foo: 20 }; + var op = { __proto__: { set bar(v) { assertUnreachable("bset"); } }, + bar: 10 }; + } +} + +for (var i = 0; i < 10; i++) { + // In global scope. + var ja = JSON.parse('[1,2,3,4]'); + var jo = JSON.parse('{"bar": 10, "foo": 20}') + var jop = JSON.parse('{"bar": 10, "__proto__": { }, "foo": 20}') + var a = [1,2,3,4]; + var o = { bar: 10, foo: 20 }; + var op = { __proto__: { set bar(v) { assertUnreachable("bset"); } }, + bar: 10 }; + // In function scope. + inFunction(); +} diff --git a/test/mjsunit/indexed-accessors.js b/test/mjsunit/indexed-accessors.js index 395f2ab3..16348570 100644 --- a/test/mjsunit/indexed-accessors.js +++ b/test/mjsunit/indexed-accessors.js @@ -81,19 +81,6 @@ testArray(); expected[0] = 111; testArray(); -// The functionality is not implemented for arrays due to performance issues. -var a = [ 1 ]; -a.__defineGetter__('2', function() { return 7; }); -assertEquals(undefined, a[2]); -assertEquals(1, a.length); -var b = 0; -a.__defineSetter__('5', function(y) { b = y; }); -assertEquals(1, a.length); -a[5] = 42; -assertEquals(0, b); -assertEquals(42, a[5]); -assertEquals(6, a.length); - // Using a setter where only a getter is defined throws an exception. var q = {}; q.__defineGetter__('0', function() { return 42; }); diff --git a/test/mjsunit/regress/regress-1017.js b/test/mjsunit/regress/regress-1017.js new file mode 100644 index 00000000..3daf5428 --- /dev/null +++ b/test/mjsunit/regress/regress-1017.js @@ -0,0 +1,36 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT +// OWNER OR 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. + +// See: http://code.google.com/p/v8/issues/detail?id=1017 + +// 32 ASCII-characters followed by a non-ASCII character. +// This causes an internal buffer to first expand to 64 bytes, then expand the +// 32 ASCII characters to 64 bytes of UC16 characters, leaving no room +// to store the 33rd character. This fails an ASSERT in debug mode. + +assertEquals(33, "12345678901234567890123456789012\u2028".length); + diff --git a/test/mjsunit/regress/regress-900.js b/test/mjsunit/regress/regress-900.js new file mode 100644 index 00000000..9f94348d --- /dev/null +++ b/test/mjsunit/regress/regress-900.js @@ -0,0 +1,46 @@ +// Copyright 2011 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT +// OWNER OR 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. + +// Check that we allow accessors on JSArray elements. + +var a = []; +var b = {} +Object.defineProperty(a, "1", {get: function() {return "foo";}}); +Object.defineProperty( + b, "1", {get: function() {return "bar";}, set: function() {this.x = 42;}}); +assertEquals(a[1], 'foo'); +assertEquals(b[1], 'bar'); +// Make sure we can't overwrite an accessor, but that the setter is +// instead called. +b[1] = 'foobar'; +assertEquals(b[1], 'bar'); +assertEquals(b.x, 42); + +var desc = Object.getOwnPropertyDescriptor(b, "1"); +assertEquals(desc['writable'], undefined); +assertFalse(desc['enumerable']); +assertFalse(desc['configurable']); diff --git a/test/mozilla/mozilla.status b/test/mozilla/mozilla.status index 1f9e6eb4..5688cf8d 100644 --- a/test/mozilla/mozilla.status +++ b/test/mozilla/mozilla.status @@ -653,8 +653,6 @@ js1_5/extensions/regress-336409-1: FAIL_OK js1_5/extensions/regress-336409-2: FAIL_OK js1_5/extensions/regress-336410-2: FAIL_OK js1_5/extensions/regress-341956-01: FAIL_OK -js1_5/extensions/regress-341956-02: FAIL_OK -js1_5/extensions/regress-341956-03: FAIL_OK js1_5/extensions/regress-345967: FAIL_OK js1_5/extensions/regress-346494-01: FAIL_OK js1_5/extensions/regress-346494: FAIL_OK |