Migrate more tests from blink repository.

All these tests had <script> tags with additional JS code. All embedded script code is (automatically) concatenated with existing .js files into one .js test file per test.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/21070002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1f9dc8b1
# 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 how deep we can recurse, and that we get an exception when we do, as opposed to a stack overflow.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded.
FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded.
FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded.
FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded.
PASS successfullyParsed is true
TEST COMPLETE
// 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 how deep we can recurse, and that we get an exception when we do, as opposed to a stack overflow.");
function simpleRecursion(depth) {
if (depth)
simpleRecursion(depth - 1);
}
try {
simpleRecursion(17472);
} catch (ex) {
debug("FAIL: " + ex);
}
try {
simpleRecursion(10000000);
} catch (ex) {
var msg = String(eval(ex));
shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'");
}
try {
simpleRecursion(1000000000);
} catch (ex) {
var msg = String(eval(ex));
shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'");
}
var tooFewArgsDepth = 0;
function tooFewArgsRecursion(a) {
if (tooFewArgsDepth) {
tooFewArgsDepth--;
tooFewArgsRecursion();
}
}
try {
tooFewArgsDepth = 10000000;
tooFewArgsRecursion();
} catch (ex) {
var msg = String(eval(ex));
shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'");
}
function tooManyArgsRecursion(depth) {
if (depth)
tooManyArgsRecursion(depth - 1, 1);
}
try {
tooManyArgsRecursion(10000000, 1);
} catch (ex) {
var msg = String(eval(ex));
shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'");
}
\ No newline at end of file
# 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 toString() round-trip decompilation for binary and unary operators.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS decompiledFunction is 'function () { x + + y;}'
PASS decompiledFunction is 'function () { x + - y;}'
PASS decompiledFunction is 'function () { x - + y;}'
PASS decompiledFunction is 'function () { x - - y;}'
PASS decompiledFunction is 'function () { x * + y;}'
PASS decompiledFunction is 'function () { x * - y;}'
PASS decompiledFunction is 'function () { x / + y;}'
PASS decompiledFunction is 'function () { x / - y;}'
PASS decompiledFunction is 'function () { x % + y;}'
PASS decompiledFunction is 'function () { x % - y;}'
PASS decompiledFunction is 'function () { x++ + y;}'
PASS decompiledFunction is 'function () { x++ - y;}'
PASS decompiledFunction is 'function () { x++ * y;}'
PASS decompiledFunction is 'function () { x++ / y;}'
PASS decompiledFunction is 'function () { x-- + y;}'
PASS decompiledFunction is 'function () { x-- - y;}'
PASS decompiledFunction is 'function () { x-- * y;}'
PASS decompiledFunction is 'function () { x-- / y;}'
PASS decompiledFunction is 'function () { x + ++y;}'
PASS decompiledFunction is 'function () { x - ++y;}'
PASS decompiledFunction is 'function () { x * ++y;}'
PASS decompiledFunction is 'function () { x / ++y;}'
PASS decompiledFunction is 'function () { x + --y;}'
PASS decompiledFunction is 'function () { x - --y;}'
PASS decompiledFunction is 'function () { x * --y;}'
PASS decompiledFunction is 'function () { x / --y;}'
PASS decompiledFunction is 'function () { x++ + ++y;}'
PASS decompiledFunction is 'function () { x++ - ++y;}'
PASS decompiledFunction is 'function () { x++ * ++y;}'
PASS decompiledFunction is 'function () { x++ / ++y;}'
PASS decompiledFunction is 'function () { x-- + ++y;}'
PASS decompiledFunction is 'function () { x-- - ++y;}'
PASS decompiledFunction is 'function () { x-- * ++y;}'
PASS decompiledFunction is 'function () { x-- / ++y;}'
PASS decompiledFunction is 'function () { x++ + --y;}'
PASS decompiledFunction is 'function () { x++ - --y;}'
PASS decompiledFunction is 'function () { x++ * --y;}'
PASS decompiledFunction is 'function () { x++ / --y;}'
PASS decompiledFunction is 'function () { x-- + --y;}'
PASS decompiledFunction is 'function () { x-- - --y;}'
PASS decompiledFunction is 'function () { x-- * --y;}'
PASS decompiledFunction is 'function () { x-- / --y;}'
PASS decompiledFunction is 'function () { + + x;}'
PASS decompiledFunction is 'function () { + - x;}'
PASS decompiledFunction is 'function () { - + x;}'
PASS decompiledFunction is 'function () { - - x;}'
PASS decompiledFunction is 'function () { 1;}'
PASS decompiledFunction is 'function () { -1;}'
PASS decompiledFunction is 'function () { - -1;}'
PASS decompiledFunction is 'function () { - - 0;}'
PASS decompiledFunction is 'function () { - - NaN;}'
PASS successfullyParsed is true
TEST COMPLETE
// 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 toString() round-trip decompilation for binary and unary operators.");
var tests = [
"x + + y",
"x + - y",
"x - + y",
"x - - y",
"x * + y",
"x * - y",
"x / + y",
"x / - y",
"x % + y",
"x % - y",
"x++ + y",
"x++ - y",
"x++ * y",
"x++ / y",
"x-- + y",
"x-- - y",
"x-- * y",
"x-- / y",
"x + ++y",
"x - ++y",
"x * ++y",
"x / ++y",
"x + --y",
"x - --y",
"x * --y",
"x / --y",
"x++ + ++y",
"x++ - ++y",
"x++ * ++y",
"x++ / ++y",
"x-- + ++y",
"x-- - ++y",
"x-- * ++y",
"x-- / ++y",
"x++ + --y",
"x++ - --y",
"x++ * --y",
"x++ / --y",
"x-- + --y",
"x-- - --y",
"x-- * --y",
"x-- / --y",
"+ + x",
"+ - x",
"- + x",
"- - x",
"1",
"-1",
"- -1",
"- - 0",
"- - NaN"
];
for (test in tests) {
var decompiledFunction = eval("(function () { " + tests[test] + ";})").toString().replace(/\n/g, "");
shouldBe("decompiledFunction", "'function () { " + tests[test] + ";}'");
}
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Array().length is 0
PASS (new Array()).length is 0
PASS (new Array(3)).length is 3
PASS (new Array(11, 22)).length is 2
PASS (new Array(11, 22))[0] is 11
PASS Array(11, 22)[1] is 22
PASS (new Array(11, 22))[3] is undefined.
PASS String(new Array(11, 22)) is '11,22'
PASS var a = []; a[0] = 33; a[0] is 33
PASS var a = []; a[0] = 33; a.length is 1
PASS var a = [11, 22]; a.length = 1; String(a); is '11'
PASS var a = [11, 22]; a.length = 1; a.length; is 1
PASS caught; is true
PASS ename is 'RangeError'
PASS caught; is true
PASS ename is 'RangeError'
PASS var a = [11, 22]; a.length = 1; a[1]; is undefined.
PASS Array().toString() is ''
PASS Array(3).toString() is ',,'
PASS Array(11, 22).toString() is '11,22'
PASS String(Array(11, 22).concat(33)) is '11,22,33'
PASS String(Array(2).concat(33, 44)) is ',,33,44'
PASS String(Array(2).concat(Array(2))) is ',,,'
PASS String(Array(11,22).concat(Array(33,44))) is '11,22,33,44'
PASS String(Array(1,2).concat(3,Array(4,5))) is '1,2,3,4,5'
PASS var a = new Array(1,2,3); delete a[1]; String(a.concat(4)) is '1,,3,4'
PASS [1,2,3,4].slice(1, 3).toString() is '2,3'
PASS [1,2,3,4].slice(-3, -1).toString() is '2,3'
PASS [1,2].slice(-9, 0).length is 0
PASS [1,2].slice(1).toString() is '2'
PASS [1,2].slice().toString() is '1,2'
PASS (new Array('a')).length is 1
PASS (new Array('a'))[0] is 'a'
PASS (new Array('a'))[1] is undefined.
PASS Array('a').length is 1
PASS Array('a')[0] is 'a'
PASS String(Array()) is ''
PASS String(Array('a','b')) is 'a,b'
PASS [].length is 0
PASS ['a'].length is 1
PASS ['a'][0] is 'a'
PASS ['a',,'c'][2] is 'c'
PASS ['a',undefined,'c'][1] is undefined
PASS ['a',,'c'][1] is undefined
PASS 1 in ['a',,'c'] is false
PASS 1 in ['a',undefined,'c'] is true
PASS 1 in arrayWithDeletion is false
PASS forInSum([]) is ''
PASS forInSum(Array()) is ''
PASS forInSum(Array('a')) is 'a'
PASS forInSum([,undefined,'x','aa']) is 'undefinedxaa'
PASS forInSum(a0) is ''
PASS forInSum(a1) is 'a'
PASS String([].sort()) is ''
PASS String([3,1,'2'].sort()) is '1,2,3'
PASS String([,'x','aa'].sort()) is 'aa,x,'
PASS String([,undefined,'x','aa'].sort()) is 'aa,x,,'
PASS 2 in [,undefined,'x','aa'].sort() is true
PASS 3 in [,undefined,'x','aa'].sort() is false
PASS var a = ['aa', 'b', 'cccc', 'ddd']; String(a.sort(comp)) is 'b,aa,ddd,cccc'
PASS [0, Infinity].sort(function(a, b) { return a - b }).toString() is '0,Infinity'
PASS [].unshift('a') is 1
PASS ['c'].unshift('a', 'b') is 3
PASS var a = []; a.unshift('a'); String(a) is 'a'
PASS var a = ['c']; a.unshift('a', 'b'); String(a) is 'a,b,c'
PASS String(['a', 'b', 'c'].splice(1, 2, 'x', 'y')) is 'b,c'
PASS arr.length is 40
PASS arr[maxint] is "test"
PASS arr.length is 40
PASS arr[maxint] is undefined
PASS arr.length is maxint
PASS arr[maxint-1] is "test2"
PASS arr.length is 40
PASS arr[55.5] is "test"
PASS arr[65.11111111111111111111111111111] is "test"
PASS arr.length is 40
PASS arr[55.5] is undefined
PASS arr[65.11111111111111111111111111111] is undefined
PASS propnames.length is 3
PASS propnames[0] is '0'
PASS propnames[1] is '1'
PASS propnames[2] is '2'
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// 15.4 Array Objects
// (c) 2001 Harri Porten <porten@kde.org>
shouldBe("Array().length", "0");
shouldBe("(new Array()).length", "0");
shouldBe("(new Array(3)).length", "3");
shouldBe("(new Array(11, 22)).length", "2");
shouldBe("(new Array(11, 22))[0]", "11");
shouldBe("Array(11, 22)[1]", "22");
shouldBeUndefined("(new Array(11, 22))[3]");
shouldBe("String(new Array(11, 22))", "'11,22'");
shouldBe("var a = []; a[0] = 33; a[0]", "33");
shouldBe("var a = []; a[0] = 33; a.length", "1");
shouldBe("var a = [11, 22]; a.length = 1; String(a);", "'11'");
shouldBe("var a = [11, 22]; a.length = 1; a.length;", "1");
// range checks
var caught = false;
var ename = "";
try {
[].length = -1;
} catch (e) {
// expect Range Error
caught = true;
ename = e.name;
}
shouldBeTrue("caught;");
shouldBe("ename", "'RangeError'");
caught = false;
ename = "";
try {
new Array(Infinity);
} catch (e) {
// expect Range Error
caught = true;
ename = e.name;
}
shouldBeTrue("caught;");
shouldBe("ename", "'RangeError'");
shouldBeUndefined("var a = [11, 22]; a.length = 1; a[1];");
shouldBe("Array().toString()", "''");
shouldBe("Array(3).toString()", "',,'");
shouldBe("Array(11, 22).toString()", "'11,22'");
shouldBe("String(Array(11, 22).concat(33))", "'11,22,33'");
shouldBe("String(Array(2).concat(33, 44))", "',,33,44'");
shouldBe("String(Array(2).concat(Array(2)))", "',,,'");
shouldBe("String(Array(11,22).concat(Array(33,44)))", "'11,22,33,44'");
shouldBe("String(Array(1,2).concat(3,Array(4,5)))", "'1,2,3,4,5'");
shouldBe("var a = new Array(1,2,3); delete a[1]; String(a.concat(4))", "'1,,3,4'");
shouldBe("[1,2,3,4].slice(1, 3).toString()", "'2,3'");
shouldBe("[1,2,3,4].slice(-3, -1).toString()", "'2,3'");
shouldBe("[1,2].slice(-9, 0).length", "0");
shouldBe("[1,2].slice(1).toString()", "'2'");
shouldBe("[1,2].slice().toString()", "'1,2'");
// 2nd set.
shouldBe("(new Array('a')).length", "1");
shouldBe("(new Array('a'))[0]", "'a'");
shouldBeUndefined("(new Array('a'))[1]");
shouldBe("Array('a').length", "1");
shouldBe("Array('a')[0]", "'a'");
shouldBe("String(Array())", "''");
shouldBe("String(Array('a','b'))", "'a,b'");
shouldBe("[].length", "0");
shouldBe("['a'].length", "1");
shouldBe("['a'][0]", "'a'");
shouldBe("['a',,'c'][2]", "'c'");
shouldBe("['a',undefined,'c'][1]", "undefined");
shouldBe("['a',,'c'][1]", "undefined");
shouldBe("1 in ['a',,'c']", "false");
shouldBe("1 in ['a',undefined,'c']", "true");
var arrayWithDeletion = ['a','b','c'];
delete arrayWithDeletion[1];
shouldBe("1 in arrayWithDeletion", "false");
function forInSum(_a) {
var s = '';
for (i in _a)
s += _a[i];
return s;
}
shouldBe("forInSum([])", "''");
shouldBe("forInSum(Array())", "''");
shouldBe("forInSum(Array('a'))", "'a'");
shouldBe("forInSum([,undefined,'x','aa'])", "'undefinedxaa'");
var a0 = [];
shouldBe("forInSum(a0)", "''");
var a1 = [ 'a' ];
shouldBe("forInSum(a1)", "'a'");
shouldBe("String([].sort())", "''")
shouldBe("String([3,1,'2'].sort())", "'1,2,3'");
shouldBe("String([,'x','aa'].sort())", "'aa,x,'");
shouldBe("String([,undefined,'x','aa'].sort())", "'aa,x,,'");
shouldBe("2 in [,undefined,'x','aa'].sort()", "true");
shouldBe("3 in [,undefined,'x','aa'].sort()", "false");
// sort by length
function comp(a, b) {
var la = String(a).length;
var lb = String(b).length;
if (la < lb)
return -1;
else if (la > lb)
return 1;
else
return 0;
}
shouldBe("var a = ['aa', 'b', 'cccc', 'ddd']; String(a.sort(comp))", "'b,aa,ddd,cccc'");
// +/-Infinity as function return value
shouldBe("[0, Infinity].sort(function(a, b) { return a - b }).toString()", "'0,Infinity'");
// Array.unshift()
shouldBe("[].unshift('a')", "1");
shouldBe("['c'].unshift('a', 'b')", "3");
shouldBe("var a = []; a.unshift('a'); String(a)", "'a'");
shouldBe("var a = ['c']; a.unshift('a', 'b'); String(a)", "'a,b,c'");
// Array.splice()
shouldBe("String(['a', 'b', 'c'].splice(1, 2, 'x', 'y'))", "'b,c'");
var maxint = Math.pow(2,32)-1;
var arr = new Array();
// 2^32 should not be treated as a valid array index, i.e.
// setting the property on the array should not result in
// the length being modified
arr.length = 40;
arr[maxint] = "test";
shouldBe("arr.length","40");
shouldBe("arr[maxint]","\"test\"");
delete arr[maxint];
shouldBe("arr.length","40");
shouldBe("arr[maxint]","undefined");
arr[maxint-1] = "test2";
shouldBe("arr.length","maxint");
shouldBe("arr[maxint-1]","\"test2\"");
// Floating point numbers also should not be treated as valid array indices.
arr.length = 40;
arr[55.5] = "test"; // does fit in a JSImmediate number
arr[65.11111111111111111111111111111] = "test"; // does not fit in a JSImmediate number
shouldBe("arr.length","40");
shouldBe("arr[55.5]","\"test\"");
shouldBe("arr[65.11111111111111111111111111111]","\"test\"");
delete arr[55.5];
delete arr[65.11111111111111111111111111111];
shouldBe("arr.length","40");
shouldBe("arr[55.5]","undefined");
shouldBe("arr[65.11111111111111111111111111111]","undefined");
arr = new Array('a','b','c');
arr.__proto__ = { 1: 'x' };
var propnames = new Array();
for (i in arr)
propnames.push(i);
propnames.sort();
shouldBe("propnames.length","3");
shouldBe("propnames[0]","'0'");
shouldBe("propnames[1]","'1'");
shouldBe("propnames[2]","'2'");
function testToString() {
// backup
var backupNumberToString = Number.prototype.toString;
var backupNumberToLocaleString = Number.prototype.toLocaleString;
var backupRegExpToString = RegExp.prototype.toString;
var backupRegExpToLocaleString = RegExp.prototype.toLocaleString;
// change functions
Number.prototype.toString = function() { return "toString"; }
Number.prototype.toLocaleString = function() { return "toLocaleString"; }
RegExp.prototype.toString = function() { return "toString2"; }
RegExp.prototype.toLocaleString = function() { return "toLocaleString2"; }
// the tests
shouldBe("[1].toString()", "'1'");
shouldBe("[1].toLocaleString()", "'toLocaleString'");
Number.prototype.toLocaleString = "invalid";
shouldBe("[1].toLocaleString()", "'1'");
shouldBe("[/r/].toString()", "'toString2'");
shouldBe("[/r/].toLocaleString()", "'toLocaleString2'");
RegExp.prototype.toLocaleString = "invalid";
shouldBe("[/r/].toLocaleString()", "'toString2'");
var caught = false;
try {
[{ toString : 0 }].toString();
} catch (e) {
caught = true;
}
shouldBeTrue("caught");
// restore
Number.prototype.toString = backupNumberToString;
Number.prototype.toLocaleString = backupNumberToLocaleString;
RegExp.prototype.toString = backupRegExpToString;
RegExp.prototype.toLocaleString = backupRegExpToLocaleString;
}
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Boolean() is false
PASS Boolean(true) is true
PASS Boolean(false) is false
PASS (new Boolean(true)).valueOf() is true
PASS (new Boolean(false)).valueOf() is false
PASS (new Boolean(Boolean(true))).valueOf() is true
PASS true.valueOf() === true is true
PASS false.toString() === 'false' is true
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("Boolean()", "false");
shouldBe("Boolean(true)", "true");
shouldBe("Boolean(false)", "false");
shouldBe("(new Boolean(true)).valueOf()", "true");
shouldBe("(new Boolean(false)).valueOf()", "false");
shouldBe("(new Boolean(Boolean(true))).valueOf()", "true");
shouldBeTrue("true.valueOf() === true");
shouldBeTrue("false.toString() === 'false'");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Start Of Test
PASS d.setYear(-1), d.getFullYear() is -1
PASS d.setYear(0), d.getFullYear() is 1900
PASS d.setYear(1), d.getFullYear() is 1901
PASS d.setYear(99), d.getFullYear() is 1999
PASS d.setYear(100), d.getFullYear() is 100
PASS d.setYear(2050), d.getFullYear() is 2050
PASS d.setYear(1899), d.getFullYear() is 1899
PASS d.setYear(2000), d.getFullYear() is 2000
PASS d.setYear(2100), d.getFullYear() is 2100
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
debug("Start Of Test");
var d = new Date();
shouldBe("d.setYear(-1), d.getFullYear()", "-1");
shouldBe("d.setYear(0), d.getFullYear()", "1900");
shouldBe("d.setYear(1), d.getFullYear()", "1901");
shouldBe("d.setYear(99), d.getFullYear()", "1999");
shouldBe("d.setYear(100), d.getFullYear()", "100");
shouldBe("d.setYear(2050), d.getFullYear()", "2050");
shouldBe("d.setYear(1899), d.getFullYear()", "1899");
shouldBe("d.setYear(2000), d.getFullYear()", "2000");
shouldBe("d.setYear(2100), d.getFullYear()", "2100");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Error('msg').message is 'msg'
PASS (new Error('msg')).message is 'msg'
PASS (new Error('msg')).name is 'Error'
PASS Object.prototype.toString.apply(Error()) is '[object Error]'
PASS Object.prototype.toString.apply(Error) is '[object Function]'
PASS Object.prototype.toString.apply(EvalError) is '[object Function]'
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// Error constructor called as a function
shouldBe("Error('msg').message", "'msg'");
// Error Constructor called as part of a new expression
shouldBe("(new Error('msg')).message", "'msg'");
// moved to evil-n.js shouldBeUndefined("(new Error()).message");
shouldBe("(new Error('msg')).name", "'Error'");
shouldBe("Object.prototype.toString.apply(Error())", "'[object Error]'");
shouldBe("Object.prototype.toString.apply(Error)", "'[object Function]'");
shouldBe("Object.prototype.toString.apply(EvalError)", "'[object Function]'");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS h.charCodeAt(1) is 239
PASS u.charCodeAt(1) is 4660
PASS escape(h) is 'a%EFc'
PASS escape(u) is 'a%u1234c'
PASS escape(z) is '%00'
PASS unescape(escape(h)) is h
PASS unescape(escape(u)) is u
PASS unescape(escape(z)) is z
PASS isNaN(NaN) is true
PASS isNaN('NaN') is true
PASS isNaN('1') is false
PASS isFinite(1) is true
PASS isFinite('1') is true
PASS isFinite('a') is false
PASS isNaN(parseInt("Hello", 8)) is true
PASS isNaN(parseInt("FFF", 10)) is true
PASS isNaN(parseInt(".5", 10)) is true
PASS isFinite(Infinity) is false
PASS isFinite('Infinity') is false
PASS isNaN(parseInt()) is true
PASS isNaN(parseInt('')) is true
PASS isNaN(parseInt(' ')) is true
PASS isNaN(parseInt('a')) is true
PASS parseInt(1) is 1
PASS parseInt(1234567890123456) is 1234567890123456
PASS parseInt(1.2) is 1
PASS parseInt(' 2.3') is 2
PASS parseInt('0x10') is 16
PASS parseInt('11', 0) is 11
PASS parseInt('F', 16) is 15
PASS isNaN(parseInt('10', 40)) is true
PASS parseInt('3x') is 3
PASS parseInt('3 x') is 3
PASS isNaN(parseInt('Infinity')) is true
PASS parseInt("15") is 15
PASS parseInt("015") is 15
PASS parseInt("0xf") is 15
PASS parseInt("15", 0) is 15
PASS parseInt("15", 10) is 15
PASS parseInt("F", 16) is 15
PASS parseInt("17", 8) is 15
PASS parseInt("15.99", 10) is 15
PASS parseInt("FXX123", 16) is 15
PASS parseInt("1111", 2) is 15
PASS parseInt("15*3", 10) is 15
PASS parseInt("0x7", 10) is 0
PASS parseInt("1x7", 10) is 1
PASS isNaN(parseFloat()) is true
PASS isNaN(parseFloat('')) is true
PASS isNaN(parseFloat(' ')) is true
PASS isNaN(parseFloat('a')) is true
PASS parseFloat(1) is 1
PASS parseFloat(' 2.3') is 2.3
PASS parseFloat('3.1 x', 3) is 3.1
PASS parseFloat('3.1x', 3) is 3.1
PASS isFinite(parseFloat('Infinity')) is false
PASS delete NaN is false
PASS delete Infinity is false
PASS delete undefined is false
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
var h = "a\xefc";
var u = "a\u1234c";
var z = "\x00";
shouldBe("h.charCodeAt(1)", "239");
shouldBe("u.charCodeAt(1)", "4660");
shouldBe("escape(h)", "'a%EFc'");
shouldBe("escape(u)", "'a%u1234c'");
shouldBe("escape(z)", "'%00'");
shouldBe("unescape(escape(h))", "h");
shouldBe("unescape(escape(u))", "u");
shouldBe("unescape(escape(z))", "z");
shouldBeTrue("isNaN(NaN)");
shouldBeTrue("isNaN('NaN')");
shouldBeFalse("isNaN('1')");
shouldBeTrue("isFinite(1)");
shouldBeTrue("isFinite('1')");
// all should return NaN because 1st char is non-number
shouldBeFalse("isFinite('a')");
shouldBe('isNaN(parseInt("Hello", 8))', "true");
shouldBe('isNaN(parseInt("FFF", 10))', "true");
shouldBe('isNaN(parseInt(".5", 10))', "true");
shouldBeFalse("isFinite(Infinity)");
shouldBeFalse("isFinite('Infinity')");
shouldBeTrue("isNaN(parseInt())");
shouldBeTrue("isNaN(parseInt(''))");
shouldBeTrue("isNaN(parseInt(' '))");
shouldBeTrue("isNaN(parseInt('a'))");
shouldBe("parseInt(1)", "1");
shouldBe("parseInt(1234567890123456)", "1234567890123456");
shouldBe("parseInt(1.2)", "1");
shouldBe("parseInt(' 2.3')", "2");
shouldBe("parseInt('0x10')", "16");
shouldBe("parseInt('11', 0)", "11");
shouldBe("parseInt('F', 16)", "15");
shouldBeTrue("isNaN(parseInt('10', 40))");
shouldBe("parseInt('3x')", "3");
shouldBe("parseInt('3 x')", "3");
shouldBeTrue("isNaN(parseInt('Infinity'))");
// all should return 15
shouldBe('parseInt("15")', "15");
shouldBe('parseInt("015")', "15"); // ES5 prohibits parseInt from handling octal, see annex E.
shouldBe('parseInt("0xf")', "15");
shouldBe('parseInt("15", 0)', "15");
shouldBe('parseInt("15", 10)', "15");
shouldBe('parseInt("F", 16)', "15");
shouldBe('parseInt("17", 8)', "15");
shouldBe('parseInt("15.99", 10)', "15");
shouldBe('parseInt("FXX123", 16)', "15");
shouldBe('parseInt("1111", 2)', "15");
shouldBe('parseInt("15*3", 10)', "15");
// this should be 0
shouldBe('parseInt("0x7", 10)', "0");
shouldBe('parseInt("1x7", 10)', "1");
shouldBeTrue("isNaN(parseFloat())");
shouldBeTrue("isNaN(parseFloat(''))");
shouldBeTrue("isNaN(parseFloat(' '))");
shouldBeTrue("isNaN(parseFloat('a'))");
shouldBe("parseFloat(1)", "1");
shouldBe("parseFloat(' 2.3')", "2.3");
shouldBe("parseFloat('3.1 x', 3)", "3.1");
shouldBe("parseFloat('3.1x', 3)", "3.1");
shouldBeFalse("isFinite(parseFloat('Infinity'))");
shouldBeFalse("delete NaN");
shouldBeFalse("delete Infinity");
shouldBeFalse("delete undefined");
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS typeof Object() is 'object'
PASS var o = Object(); o.x = 11; o.x; is 11
PASS Object(1).valueOf() is 1
PASS Object(true).valueOf() is true
PASS Object('s').valueOf() is 's'
PASS typeof (new Object()) is 'object'
PASS (new Object(1)).valueOf() is 1
PASS (new Object(true)).valueOf() is true
PASS (new Object('s')).valueOf() is 's'
PASS String(Object()) is '[object Object]'
PASS Object().toString() is '[object Object]'
PASS String(Object().valueOf()) is '[object Object]'
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("typeof Object()", "'object'");
shouldBe("var o = Object(); o.x = 11; o.x;", "11"); // wanted behaviour ?
// shouldBe("Object(undefined)", ???);
// shouldBe("Object(null)", ???);
shouldBe("Object(1).valueOf()", "1");
shouldBe("Object(true).valueOf()", "true");
shouldBe("Object('s').valueOf()", "'s'");
shouldBe("typeof (new Object())", "'object'");
// shouldBe("new Object(undefined)", ???);
// shouldBe("new Object(null)", ???);
shouldBe("(new Object(1)).valueOf()", "1");
shouldBe("(new Object(true)).valueOf()", "true");
shouldBe("(new Object('s')).valueOf()", "'s'");
shouldBe("String(Object())", "'[object Object]'");
shouldBe("Object().toString()", "'[object Object]'");
shouldBe("String(Object().valueOf())", "'[object Object]'");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS s.area() is 9
PASS b.name is 'a book'
PASS b.author is 'Fred'
PASS delete Boolean.prototype is false
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
///////////////////////////////////////////////////////
function Square(x)
{
this.x = x;
}
new Square(0); // create prototype
function Square_area() { return this.x * this.x; }
Square.prototype.area = Square_area;
var s = new Square(3);
shouldBe("s.area()", "9");
///////////////////////////////////////////////////////
function Item(name){
this.name = name;
}
function Book(name, author){
this.base = Item; // set Item constructor as method of Book object
this.base(name); // set the value of name property
this.author = author;
}
Book.prototype = new Item;
var b = new Book("a book", "Fred"); // create object instance
//edebug(e"b.name"));
shouldBe("b.name", "'a book'");
shouldBe("b.author", "'Fred'"); // outpus "Fred"
///////////////////////////////////////////////////////
shouldBe("delete Boolean.prototype", "false");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS (new RegExp()).source is '(?:)'
PASS Boolean(new RegExp()) is true
PASS isNaN(Number(new RegExp())) is true
PASS RegExp(/x/).source is 'x'
PASS RegExp('x', 'g').global is true
PASS RegExp('x').source is 'x'
PASS new RegExp('x').source is 'x'
PASS (/a/).global is false
PASS typeof (/a/).global is 'boolean'
PASS rg.global is true
PASS (/a/).ignoreCase is false
PASS ri.ignoreCase is true
PASS (/a/).multiline is false
PASS rm.multiline is true
PASS rg.toString() is '/a/g'
PASS ri.toString() is '/a/i'
PASS rm.toString() is '/a/m'
PASS rg.global is true
PASS ri.ignoreCase is true
PASS rm.multiline is true
PASS Boolean(/a/.test) is true
PASS /(b)c/.exec('abcd').toString() is "bc,b"
PASS /(b)c/.exec('abcd').length is 2
PASS /(b)c/.exec('abcd').index is 1
PASS /(b)c/.exec('abcd').input is 'abcd'
PASS rs.source is 'foo'
PASS var r = new RegExp(/x/); r.global=true; r.lastIndex = -1; typeof r.test('a') is 'boolean'
PASS 'abcdefghi'.match(/(abc)def(ghi)/).toString() is 'abcdefghi,abc,ghi'
PASS /(abc)def(ghi)/.exec('abcdefghi').toString() is 'abcdefghi,abc,ghi'
PASS RegExp.$1 is 'abc'
PASS RegExp.$2 is 'ghi'
PASS RegExp.$3 is ''
PASS 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/).toString() is 'abcdefghi,abcdefghi,bcdefgh,cdefg,def,e'
PASS RegExp.$1 is 'abcdefghi'
PASS RegExp.$2 is 'bcdefgh'
PASS RegExp.$3 is 'cdefg'
PASS RegExp.$4 is 'def'
PASS RegExp.$5 is 'e'
PASS RegExp.$6 is ''
PASS '(100px 200px 150px 15px)'.match(/\((\d+)(px)* (\d+)(px)* (\d+)(px)* (\d+)(px)*\)/).toString() is '(100px 200px 150px 15px),100,px,200,px,150,px,15,px'
PASS RegExp.$1 is '100'
PASS RegExp.$3 is '200'
PASS RegExp.$5 is '150'
PASS RegExp.$7 is '15'
PASS ''.match(/((\d+)(px)* (\d+)(px)* (\d+)(px)* (\d+)(px)*)/) is null
PASS RegExp.$1 is '100'
PASS RegExp.$3 is '200'
PASS RegExp.$5 is '150'
PASS RegExp.$7 is '15'
PASS 'faure@kde.org'.match(invalidChars) == null is true
PASS 'faure-kde@kde.org'.match(invalidChars) == null is false
PASS 'test1test2'.replace('test','X') is 'X1test2'
PASS 'test1test2'.replace(/\d/,'X') is 'testXtest2'
PASS '1test2test3'.replace(/\d/,'') is 'test2test3'
PASS 'test1test2'.replace(/test/g,'X') is 'X1X2'
PASS '1test2test3'.replace(/\d/g,'') is 'testtest'
PASS '1test2test3'.replace(/x/g,'') is '1test2test3'
PASS 'test1test2'.replace(/(te)(st)/g,'$2$1') is 'stte1stte2'
PASS 'foo+bar'.replace(/\+/g,'%2B') is 'foo%2Bbar'
PASS caught is true
PASS 'foo'.replace(/z?/g,'x') is 'xfxoxox'
PASS 'test test'.replace(/\s*/g,'') is 'testtest'
PASS 'abc$%@'.replace(/[^0-9a-z]*/gi,'') is 'abc'
PASS 'ab'.replace(/[^\d\.]*/gi,'') is ''
PASS '1ab'.replace(/[^\d\.]*/gi,'') is '1'
PASS '1test2test3blah'.split(/test/).toString() is '1,2,3blah'
PASS reg.exec(str).toString() is '98 ,98 '
PASS reg.lastIndex is 3
PASS RegExp.$1 is '98 '
PASS RegExp.$2 is ''
PASS reg.exec(str).toString() is '76 ,76 '
PASS reg.lastIndex is 6
PASS RegExp.$1 is '76 '
PASS RegExp.$2 is ''
PASS reg.exec(str) is null
PASS reg.lastIndex is 0
PASS myRe=/d(b+)d/g; myArray = myRe.exec('cdbbdbsbz'); myRe.lastIndex is 5
PASS reg.ignoreCase == true is true
PASS reg.global === false is true
PASS reg.multiline === false is true
PASS reg.test('UGO') is true
PASS reg.x = 1; reg.x is 1
PASS var r2 = reg; r2.x = 2; reg.x is 2
PASS str.match(re).toString() is 'Chapter 3.4.5.1,Chapter 3.4.5.1,.1'
PASS str.match(/d/gi).toString() is 'D,d'
PASS /\u0061/.source is '\\u0061'
PASS 'abc'.match(/\u0062/).toString() is 'b'
PASS Object.prototype.toString.apply(RegExp.prototype) is '[object RegExp]'
PASS typeof RegExp.prototype.toString() is 'string'
PASS new RegExp().toString() is '/(?:)/'
PASS (new RegExp('(?:)')).source is '(?:)'
PASS /(?:)/.toString() is '/(?:)/'
PASS /(?:)/.source is '(?:)'
Done.
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("(new RegExp()).source", "'(?:)'");
shouldBe("Boolean(new RegExp())", "true");
shouldBeTrue("isNaN(Number(new RegExp()))");
// RegExp constructor called as a function
shouldBe("RegExp(/x/).source", "'x'");
//shouldBe("RegExp(/x/, 'g').source", "'/x/'"); // can't supply flags when constructing one RegExp from another, says mozilla
shouldBe("RegExp('x', 'g').global", "true");
shouldBe("RegExp('x').source", "'x'");
// RegExp constructor
shouldBe("new RegExp('x').source", "'x'");
var ri = /a/i;
var rm = /a/m;
var rg = /a/g;
shouldBeFalse("(/a/).global");
shouldBe("typeof (/a/).global", "'boolean'");
shouldBeTrue("rg.global");
shouldBeFalse("(/a/).ignoreCase");
shouldBeTrue("ri.ignoreCase");
shouldBeFalse("(/a/).multiline");
shouldBeTrue("rm.multiline");
shouldBe("rg.toString()", "'/a/g'");
shouldBe("ri.toString()", "'/a/i'");
shouldBe("rm.toString()", "'/a/m'");
// check properety attributes
rg.global = false;
shouldBeTrue("rg.global");
ri.ignoreCase = false;
shouldBeTrue("ri.ignoreCase");
rm.multiline = false;
shouldBeTrue("rm.multiline");
shouldBe("Boolean(/a/.test)", "true");
shouldBe("/(b)c/.exec('abcd').toString()", "\"bc,b\"");
shouldBe("/(b)c/.exec('abcd').length", "2");
shouldBe("/(b)c/.exec('abcd').index", "1");
shouldBe("/(b)c/.exec('abcd').input", "'abcd'");
var rs = /foo/;
rs.source = "bar";
shouldBe("rs.source", "'foo'");
shouldBe("var r = new RegExp(/x/); r.global=true; r.lastIndex = -1; typeof r.test('a')", "'boolean'");
shouldBe("'abcdefghi'.match(/(abc)def(ghi)/).toString()","'abcdefghi,abc,ghi'");
shouldBe("/(abc)def(ghi)/.exec('abcdefghi').toString()","'abcdefghi,abc,ghi'");
shouldBe("RegExp.$1","'abc'");
shouldBe("RegExp.$2","'ghi'");
shouldBe("RegExp.$3","''");
shouldBe("'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/).toString()", "'abcdefghi,abcdefghi,bcdefgh,cdefg,def,e'");
shouldBe("RegExp.$1","'abcdefghi'");
shouldBe("RegExp.$2","'bcdefgh'");
shouldBe("RegExp.$3","'cdefg'");
shouldBe("RegExp.$4","'def'");
shouldBe("RegExp.$5","'e'");
shouldBe("RegExp.$6","''");
shouldBe("'(100px 200px 150px 15px)'.match(/\\((\\d+)(px)* (\\d+)(px)* (\\d+)(px)* (\\d+)(px)*\\)/).toString()","'(100px 200px 150px 15px),100,px,200,px,150,px,15,px'");
shouldBe("RegExp.$1","'100'");
shouldBe("RegExp.$3","'200'");
shouldBe("RegExp.$5","'150'");
shouldBe("RegExp.$7","'15'");
shouldBe("''.match(/\((\\d+)(px)* (\\d+)(px)* (\\d+)(px)* (\\d+)(px)*\)/)","null");
// After a failed match, cached results on the RegExp object are unchanged.
shouldBe("RegExp.$1","'100'");
shouldBe("RegExp.$3","'200'");
shouldBe("RegExp.$5","'150'");
shouldBe("RegExp.$7","'15'");
var invalidChars = /[^@\.\w]/g; // #47092
shouldBe("'faure@kde.org'.match(invalidChars) == null", "true");
shouldBe("'faure-kde@kde.org'.match(invalidChars) == null", "false");
shouldBe("'test1test2'.replace('test','X')","'X1test2'");
shouldBe("'test1test2'.replace(/\\d/,'X')","'testXtest2'");
shouldBe("'1test2test3'.replace(/\\d/,'')","'test2test3'");
shouldBe("'test1test2'.replace(/test/g,'X')","'X1X2'");
shouldBe("'1test2test3'.replace(/\\d/g,'')","'testtest'");
shouldBe("'1test2test3'.replace(/x/g,'')","'1test2test3'");
shouldBe("'test1test2'.replace(/(te)(st)/g,'$2$1')","'stte1stte2'");
shouldBe("'foo+bar'.replace(/\\+/g,'%2B')", "'foo%2Bbar'");
var caught = false; try { new RegExp("+"); } catch (e) { caught = true; }
shouldBeTrue("caught"); // #40435
shouldBe("'foo'.replace(/z?/g,'x')", "'xfxoxox'");
shouldBe("'test test'.replace(/\\s*/g,'')","'testtest'"); // #50985
shouldBe("'abc$%@'.replace(/[^0-9a-z]*/gi,'')","'abc'"); // #50848
shouldBe("'ab'.replace(/[^\\d\\.]*/gi,'')","''"); // #75292
shouldBe("'1ab'.replace(/[^\\d\\.]*/gi,'')","'1'"); // #75292
shouldBe("'1test2test3blah'.split(/test/).toString()","'1,2,3blah'");
var reg = /(\d\d )/g;
var str = new String('98 76 blah');
shouldBe("reg.exec(str).toString()","'98 ,98 '");
shouldBe("reg.lastIndex","3");
shouldBe("RegExp.$1","'98 '");
shouldBe("RegExp.$2","''");
shouldBe("reg.exec(str).toString()","'76 ,76 '");
shouldBe("reg.lastIndex","6");
shouldBe("RegExp.$1","'76 '");
shouldBe("RegExp.$2","''");
shouldBe("reg.exec(str)","null");
shouldBe("reg.lastIndex","0");
// http://www.devguru.com/Technologies/ecmascript/quickref/regexp_lastindex.html
// Looks IE-only though
//shouldBe( "var re=/ships*\s/; re.exec('the hardships of traveling'); re.lastIndex", "14" );
//shouldBe( "var re=/ships*\s/; str='the hardships of traveling'; re.exec(str); re.exec(str); re.lastIndex", "0" );
// http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/regexp.html
shouldBe( "myRe=/d(b+)d/g; myArray = myRe.exec('cdbbdbsbz'); myRe.lastIndex", "5" );
reg = /^u/i;
shouldBeTrue("reg.ignoreCase == true");
shouldBeTrue("reg.global === false");
shouldBeTrue("reg.multiline === false");
shouldBeTrue("reg.test('UGO')");
// regexp are writable ?
shouldBe("reg.x = 1; reg.x", "1");
// shared data ?
shouldBe("var r2 = reg; r2.x = 2; reg.x", "2");
var str = new String("For more information, see Chapter 3.4.5.1");
re = /(chapter \d+(\.\d)*)/i;
// This returns the array containing Chapter 3.4.5.1,Chapter 3.4.5.1,.1
// 'Chapter 3.4.5.1' is the first match and the first value remembered from (Chapter \d+(\.\d)*).
// '.1' is the second value remembered from (\.\d)
shouldBe("str.match(re).toString()","'Chapter 3.4.5.1,Chapter 3.4.5.1,.1'");
str = "abcDdcba";
// The returned array contains D, d.
shouldBe("str.match(/d/gi).toString()","'D,d'");
// unicode escape sequence
shouldBe("/\\u0061/.source", "'\\\\u0061'");
shouldBe("'abc'.match(/\\u0062/).toString()", "'b'");
shouldBe("Object.prototype.toString.apply(RegExp.prototype)",
        "'[object RegExp]'");
// not sure what this should return. most importantly
// it doesn't throw an exception
shouldBe("typeof RegExp.prototype.toString()", "'string'");
// Empty regular expressions have string representation /(?:)/
shouldBe("new RegExp().toString()", "'/(?:)/'");
shouldBe("(new RegExp('(?:)')).source", "'(?:)'");
shouldBe("/(?:)/.toString()", "'/(?:)/'");
shouldBe("/(?:)/.source", "'(?:)'");
debug("Done.");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS test0
PASS test1
PASS test2
PASS test3
PASS test4.(1)
PASS test4.(2)
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// We can't use normal shouldBe here, since they'd eval in the wrong context...
function shouldBeOfType(msg, val, type) {
if (typeof(val) != type)
testFailed(msg + ": value has type " + typeof(val) + " , not:" + type);
else
testPassed(msg);
}
function test0() {
var arguments;
// var execution should not overwrite something that was
// in scope beforehand -- e.g. the arguments thing
shouldBeOfType("test0", arguments, 'object');
}
function test1() {
// No need to undef-initialize something in scope already!
shouldBeOfType("test1", arguments, 'object');
var arguments;
}
function test2(arguments) {
// Formals OTOH can overwrite the args object
shouldBeOfType("test2", arguments, 'number');
}
function test3() {
// Ditto for functions..
shouldBeOfType("test3", arguments, 'function');
function arguments() {}
}
function test4() {
// Here, the -declaration- part of the var below should have no
// effect..
shouldBeOfType('test4.(1)', arguments, 'object');
var arguments = 4;
// .. but the assignment shoud just happen
shouldBeOfType('test4.(2)', arguments, 'number');
}
test0();
test1();
test2(42);
test3();
test4();
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS var i = 1; i is 1
PASS j = k = 2 is 2
PASS var i; i is undefined.
PASS var i = 1; i <<= 2 is 4
PASS var i = 8; i >>= 1 is 4
PASS var i = 1; i >>= 2 is 0
PASS var i = -8; i >>= 24 is -1
PASS var i = 8; i >>>= 2 is 2
PASS var i = -8; i >>>= 24 is 255
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// simple assignment
shouldBe("var i = 1; i", "1");
shouldBe("j = k = 2", "2");
shouldBeUndefined("var i; i");
// compound assignments
shouldBe("var i = 1; i <<= 2", "4");
shouldBe("var i = 8; i >>= 1", "4");
shouldBe("var i = 1; i >>= 2", "0");
shouldBe("var i = -8; i >>= 24", "-1");
shouldBe("var i = 8; i >>>= 2", "2");
shouldBe("var i = -8; i >>>= 24", "255");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Boolean(1) === true is true
PASS var s = String; s(1) === '1' is true
PASS n = Number; n(true) === 1 is true
PASS String(Array('a', 'b' )) is 'a,b'
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBeTrue("Boolean(1) === true");
shouldBeTrue("var s = String; s(1) === '1'");
shouldBeTrue("n = Number; n(true) === 1");
shouldBe("String(Array('a', 'b'        ))", "'a,b'");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// comment with linebreak
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// comment with linebreak
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS foo(), i is 2
PASS caught is true
PASS val is 11
PASS val is 12
PASS val is 13
PASS val is 14
PASS val is 15
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
var i = 1;
function foo() {
i = 2;
return;
i = 3;
}
shouldBe("foo(), i", "2");
var caught = false;
try { eval("return;"); } catch(e) { caught = true; }
shouldBeTrue("caught");
// value completions take precedence
var val = eval("11; { }");
shouldBe("val", "11");
val = eval("12; ;");
shouldBe("val", "12");
val = eval("13; if(false);");
shouldBe("val", "13");
val = eval("14; function f() {}");
shouldBe("val", "14");
val = eval("15; var v = 0");
shouldBe("val", "15");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS true ? 1 : 2 is 1
PASS false ? 1 : 2 is 2
PASS 'abc' ? 1 : 2 is 1
PASS null ? 1 : 2 is 2
PASS undefined ? 1 : 2 is 2
PASS /*var a=1;if (undefined) a = 2;*/ a is 1
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("true ? 1 : 2", "1");
shouldBe("false ? 1 : 2", "2");
shouldBe("'abc' ? 1 : 2", "1");
shouldBe("null ? 1 : 2", "2");
shouldBe("undefined ? 1 : 2", "2");
var a = 1;
if ( undefined )
a = 2;
shouldBe("/*var a=1;if (undefined) a = 2;*/ a", "1");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.length is 1
PASS Function.length is 1
PASS Array.length is 1
PASS String.length is 1
PASS Boolean.length is 1
PASS Number.length is 1
PASS Date.length is 7
PASS RegExp.length is 2
PASS Error.length is 1
PASS EvalError.length is 1
PASS RangeError.length is 1
PASS ReferenceError.length is 1
PASS SyntaxError.length is 1
PASS TypeError.length is 1
PASS URIError.length is 1
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("Object.length","1");
shouldBe("Function.length","1");
shouldBe("Array.length","1");
shouldBe("String.length","1");
shouldBe("Boolean.length","1");
shouldBe("Number.length","1");
shouldBe("Date.length","7");
shouldBe("RegExp.length","2");
shouldBe("Error.length","1");
shouldBe("EvalError.length","1");
shouldBe("RangeError.length","1");
shouldBe("ReferenceError.length","1");
shouldBe("SyntaxError.length","1");
shouldBe("TypeError.length","1");
shouldBe("URIError.length","1");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// infinite recursion
try {
var v = [];
v[0] = v;
v.toString();
} catch (e) {
debug("OK. Caught an exception.");
}
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
OK. Caught an exception
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// infinite recursion 2
function foo() {
foo();
}
try {
foo();
} catch (e) {
debug("OK. Caught an exception");
}
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS a = 1; delete a; is true
PASS delete nonexistant; is true
PASS delete NaN is false
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("a = 1; delete a;", "true");
shouldBe("delete nonexistant;", "true");
shouldBe("delete NaN", "false");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
// 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("KDE JS Test");
// --------------------------------------------------------------------------------
var resolution = 251; // set to 1 for 100% coverage
function checkEncodeException(encodeFunctionName,c1,c2)
{
if (c2 == undefined)
shouldThrow(encodeFunctionName
+ "(String.fromCharCode(" + c1 + "))");
else
shouldThrow(encodeFunctionName
+ "(String.fromCharCode(" + c1 + ") + String.fromCharCode(" + c2 + "))");
}
function checkEncodeDecode(encodeFunctionName, decodeFunctionName, c1, c2)
{
if (c2 == undefined)
shouldBe(decodeFunctionName + "(" + encodeFunctionName
+ "(String.fromCharCode(" + c1 + ")))",
"String.fromCharCode(" + c1 + ")");
else
shouldBe(decodeFunctionName + "(" + encodeFunctionName
+ "(String.fromCharCode(" + c1 + ") + String.fromCharCode(" + c2 + ")))",
"String.fromCharCode(" + c1 + ") + String.fromCharCode(" + c2 + ")");
}
function checkWithFunctions(encodeFunction, decodeFunction)
{
checkEncodeDecode(encodeFunction, decodeFunction, 0);
checkEncodeDecode(encodeFunction, decodeFunction, 0xD7FF);
checkEncodeDecode(encodeFunction, decodeFunction, 0xE000);
checkEncodeDecode(encodeFunction, decodeFunction, 0xFFFD);
checkEncodeDecode(encodeFunction, decodeFunction, 0xFFFE);
checkEncodeDecode(encodeFunction, decodeFunction, 0xFFFF);
checkEncodeException(encodeFunction, 0xDC00);
checkEncodeException(encodeFunction, 0xDFFF);
checkEncodeDecode(encodeFunction, decodeFunction, 0xD800, 0xDC00);
checkEncodeDecode(encodeFunction, decodeFunction, 0xDBFF, 0xDC00);
checkEncodeDecode(encodeFunction, decodeFunction, 0xD800, 0xDFFF);
checkEncodeDecode(encodeFunction, decodeFunction, 0xDBFF, 0xDFFF);
checkEncodeException(encodeFunction, 0xD800, 0);
checkEncodeException(encodeFunction, 0xD800, 0xD7FF);
checkEncodeException(encodeFunction, 0xD800, 0xD800);
checkEncodeException(encodeFunction, 0xD800, 0xDBFF);
checkEncodeException(encodeFunction, 0xD800, 0xE000);
checkEncodeException(encodeFunction, 0xD800, 0xE000);
checkEncodeException(encodeFunction, 0xD800, 0xFFFD);
checkEncodeException(encodeFunction, 0xD800, 0xFFFE);
checkEncodeException(encodeFunction, 0xD800, 0xFFFF);
for (var charcode = 1; charcode < 0xD7FF; charcode += resolution)
checkEncodeDecode(encodeFunction, decodeFunction, charcode);
for (var charcode = 0xE001; charcode < 0xFFFD; charcode += resolution)
checkEncodeDecode(encodeFunction, decodeFunction, charcode);
for (var charcode = 0xDC01; charcode < 0xDFFF; charcode += resolution)
checkEncodeException(encodeFunction, charcode);
for (var charcode = 0xD801; charcode < 0xDBFF; charcode += resolution)
checkEncodeDecode(encodeFunction, decodeFunction, charcode, 0xDC00);
for (var charcode = 0xDC01; charcode < 0xDFFF; charcode += resolution)
checkEncodeDecode(encodeFunction, decodeFunction, 0xD800, charcode);
for (var charcode = 1; charcode < 0xDBFF; charcode += resolution)
checkEncodeException(encodeFunction, 0xD800, charcode);
for (var charcode = 0xE001; charcode < 0xFFFD; charcode += resolution)
checkEncodeException(encodeFunction, 0xD800, charcode);
}
checkWithFunctions("encodeURI", "decodeURI");
checkWithFunctions("encodeURIComponent", "decodeURIComponent");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS eval.length is 1
PASS eval('this') is this
PASS bx is 99
PASS cx is 99
PASS Skipping test for deprecated Object.prototype.eval()
PASS lotto() is 0
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("eval.length", "1");
shouldBe("eval('this')", "this");
function MyObject() {
this.x = 99;
}
eval("b = new MyObject();");
var bx = b.x // rule out side effects of eval() in shouldBe() test function
shouldBe("bx", "99");
eval("var c = new MyObject();"); // the 'var' makes a difference
var cx = c.x;
shouldBe("cx", "99");
// KDE bug #45679
if (true.eval) {
var o = { str:1 };
shouldBe("o.eval('str')", "1");
shouldBe("o.eval('this')", "this");
} else {
testPassed("Skipping test for deprecated Object.prototype.eval()");
}
// problem from within khtml
function lotto() {
// j must be accessible to eval()
for (var j = 0; j < 1; j++)
return eval('j');
}
shouldBe("lotto()", "0");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS (new Error()).message is ''
PASS ''.split(/.*/).length is 0
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("(new Error()).message", "''");
// the empty match isn't taken in account
shouldBe("''.split(/.*/).length", "0");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS func_ret_with_ex_func is 4
PASS func_ret_from_ex_throw_args is 4
PASS set_from_throw_func_args is 4
PASS set_from_func_throw_args is 4
PASS set_from_before_func_throw_args is 1
PASS function_param_order is 'abc'
PASS new_param_order is 'abc'
PASS elision_param_order is 'abc'
PASS comma_order is 'abc'
PASS OpEqEq_part1 is 1
PASS OpEqEq_part2 is 4
PASS OpNotEq_part1 is 1
PASS OpNotEq_part2 is 4
PASS OpStrEq_part1 is 1
PASS OpStrEq_part2 is 4
PASS OpStrNEq_part1 is 1
PASS OpStrNEq_part2 is 4
PASS OpLess_part1 is 1
PASS OpLess_part2 is 4
PASS OpLessEq_part1 is 1
PASS OpLessEq_part2 is 4
PASS OpGreater_part1 is 1
PASS OpGreater_part2 is 4
PASS OpGreaterEq_part1 is 1
PASS OpGreaterEq_part2 is 4
PASS OpAnd_part1 is 1
PASS OpAnd_part2 is 4
PASS OpOr_part1 is 1
PASS OpOr_part2 is 4
PASS OpBitAnd_part1 is 1
PASS OpBitAnd_part2 is 4
PASS OpBitXOr_part1 is 1
PASS OpBitXOr_part2 is 4
PASS OpBitOr_part1 is 1
PASS OpBitOr_part2 is 4
PASS OpLShift_part1 is 1
PASS OpLShift_part2 is 4
PASS OpRShift_part1 is 1
PASS OpRShift_part2 is 4
PASS OpURShift_part1 is 1
PASS OpURShift_part2 is 4
PASS OpInstanceOf_part1 is 1
PASS OpInstanceOf_part2 is 4
PASS set_from_if_stmt is 4
PASS set_from_if_else_stmt is 4
PASS set_from_else_in_if_else_stmt is 4
PASS comma_left is 1
PASS comma_left is 4
PASS vardecl_assign_throws is 4
PASS var_assign_before_throw_run is true
PASS var_assign_after_throw_run is false
PASS do_val is 5
PASS while_val is 4
PASS for_val_part1_throw2 is 1
PASS for_val_part1_throw3 is 1
PASS for_val_part2_throw1 is 4
PASS for_val_part2_throw3 is 1
PASS for_val_part3_throw1 is 4
PASS for_val_part3_throw2 is 4
PASS for_val_part1_throwbody is 1
PASS for_val_part2_throwbody is 1
PASS for_val_part3_throwbody is 4
PASS forin_count is 4
PASS set_inside_with_throw is 4
PASS set_inside_with_cantconverttoobject is 4
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
var global = this;
function myfunc() {
}
function throwex() {
throw new Error("test exception");
}
//---------------------------
var func_ret_with_ex_func = 4;
try {
func_ret_with_ex_func = throwex()();
}
catch (e) {
}
shouldBe("func_ret_with_ex_func", "4");
// ---------------------------------
var func_ret_from_ex_throw_args = 4;
try {
func_ret_from_ex_throw_args = Math.abs(throwex());
}
catch (e) {
}
shouldBe("func_ret_from_ex_throw_args", "4");
// ---------------------------------
var set_from_throw_func_args = 4;
try {
throwex()(set_from_throw_func_args = 1);
}
catch (e) {
}
shouldBe("set_from_throw_func_args","4");
// ---------------------------------
var set_from_func_throw_args = 4;
try {
myfunc(throwex(), set_from_func_throw_args = 1);
}
catch (e) {
}
shouldBe("set_from_func_throw_args","4");
// ---------------------------------
var set_from_before_func_throw_args = 4;
try {
myfunc(set_from_before_func_throw_args = 1, throwex());
}
catch (e) {
}
shouldBe("set_from_before_func_throw_args","1");
// ---------------------------------
// ### move to function.js
var function_param_order = "";
function aparam() {
function_param_order += "a";
}
function bparam() {
function_param_order += "b";
}
function cparam() {
function_param_order += "c";
}
myfunc(aparam(),bparam(),cparam());
shouldBe("function_param_order","'abc'");
// ---------------------------------
// ### move to function.js
var new_param_order = "";
function anewparam() {
new_param_order += "a";
}
function bnewparam() {
new_param_order += "b";
}
function cnewparam() {
new_param_order += "c";
}
new myfunc(anewparam(),bnewparam(),cnewparam());
shouldBe("new_param_order","'abc'");
// ---------------------------------
// ### move to function.js
var elision_param_order = "";
function aelision() {
elision_param_order += "a";
}
function belision() {
elision_param_order += "b";
}
function celision() {
elision_param_order += "c";
}
[aelision(),belision(),celision()];
shouldBe("elision_param_order","'abc'");
// ---------------------------------
// ### move to function.js
var comma_order = "";
function acomma() {
comma_order += "a";
}
function bcomma() {
comma_order += "b";
}
function ccomma() {
comma_order += "c";
}
acomma(),bcomma(),ccomma();
shouldBe("comma_order","'abc'");
// ---------------------------------
function checkOperator(op,name) {
var code =(
"global."+name+"_part1 = 4;\n"+
"try {\n"+
" ("+name+"_part1 = 1) "+op+" throwex();\n"+
"}\n"+
"catch (e) {\n"+
"}\n"+
"shouldBe('"+name+"_part1', '1');\n"+
"global."+name+"_part2 = 4;\n"+
"try {\n"+
" throwex() "+op+" ("+name+"_part2 = 1);\n"+
"}\n"+
"catch (e) {\n"+
"}\n"+
"shouldBe('"+name+"_part2', '4');\n");
// print("\n\n\n");
// print(code);
eval(code);
}
checkOperator("==","OpEqEq");
checkOperator("!=","OpNotEq");
checkOperator("===","OpStrEq");
checkOperator("!==","OpStrNEq");
// ### these generate a syntax error in mozilla - kjs should do the same (?)
//checkOperator("+=","OpPlusEq");
//checkOperator("-=","OpMinusEq");
//checkOperator("*=","OpMultEq");
//checkOperator("/=","OpDivEq");
// OpPlusPlus,
//                 OpMinusMinus,
checkOperator("<","OpLess");
checkOperator("<=","OpLessEq");
checkOperator(">","OpGreater");
checkOperator(">=","OpGreaterEq");
//checkOperator("&=","OpAndEq");
//checkOperator("^=","OpXOrEq");
//checkOperator("|=","OpOrEq");
//checkOperator("%=","OpModEq");
checkOperator("&&","OpAnd");
checkOperator("||","OpOr");
checkOperator("&","OpBitAnd");
checkOperator("^","OpBitXOr");
checkOperator("|","OpBitOr");
checkOperator("<<","OpLShift");
checkOperator(">>","OpRShift");
checkOperator(">>>","OpURShift");
//                 OpIn,
checkOperator("instanceof","OpInstanceOf");
// ---------------------------------
var set_from_if_stmt = 4;
try {
if (throwex()) {
set_from_if_stmt = 1;
}
}
catch (e) {
}
shouldBe("set_from_if_stmt","4");
// ---------------------------------
var set_from_if_else_stmt = 4;
try {
if (throwex()) {
set_from_if_else_stmt = 1;
}
else {
undefined;
}
}
catch (e) {
}
shouldBe("set_from_if_else_stmt","4");
// ---------------------------------
var set_from_else_in_if_else_stmt = 4;
try {
if (throwex()) {
undefined;
}
else {
set_from_else_in_if_else_stmt = 1;
}
}
catch (e) {
}
shouldBe("set_from_else_in_if_else_stmt","4");
// ---------------------------------
var comma_left = 4;
try {
comma_left = 1, throwex();
}
catch (e) {
}
shouldBe("comma_left","1");
// ---------------------------------
var comma_left = 4;
try {
throwex(), comma_left = 1;
}
catch (e) {
}
shouldBe("comma_left","4");
var vardecl_assign_throws = 4;
try {
var vardecl_assign_throws = throwex();
}
catch (e) {
}
shouldBe("vardecl_assign_throws","4");
// ---------------------------------
var var_assign_before_throw_run = false;
function var_assign_before_throw() {
var_assign_before_throw_run = true;
return 1;
}
var var_assign_after_throw_run = false;
function var_assign_after_throw() {
var_assign_after_throw_run = true;
return 1;
}
try {
var var_assign1 = var_assign_before_throw(),
var_assign2 = throwex(),
var_assign1 = var_assign_before_throw();
}
catch (e) {
}
shouldBe("var_assign_before_throw_run","true");
shouldBe("var_assign_after_throw_run","false");
// ---------------------------------
var do_val = 4;
try {
do {
do_val++;
}
while (throwex());
}
catch (e) {
}
shouldBe("do_val","5");
// ---------------------------------
var while_val = 4;
try {
while (throwex()) {
while_val++;
}
}
catch (e) {
}
shouldBe("while_val","4");
// ---------------------------------
var for_val_part1_throw2 = 4;
try {
for (for_val_part1_throw2 = 1; throwex(); ) {
}
}
catch (e) {
}
shouldBe("for_val_part1_throw2","1");
// ---------------------------------
var for_val_part1_throw3 = 4;
try {
for (for_val_part1_throw3 = 1; ; throwex()) {
}
}
catch (e) {
}
shouldBe("for_val_part1_throw3","1");
// ---------------------------------
var for_val_part2_throw1 = 4;
try {
for (throwex(); for_val_part2_throw1 = 1; ) {
}
}
catch (e) {
}
shouldBe("for_val_part2_throw1","4");
// ---------------------------------
var for_val_part2_throw3 = 4;
try {
for (; for_val_part2_throw3 = 1; throwex()) {
}
}
catch (e) {
}
shouldBe("for_val_part2_throw3","1");
// ---------------------------------
var for_val_part3_throw1 = 4;
try {
for (throwex(); ; for_val_part3_throw1 = 1) {
}
}
catch (e) {
}
shouldBe("for_val_part3_throw1","4");
// ---------------------------------
var for_val_part3_throw2 = 4;
try {
for (; throwex(); for_val_part3_throw2 = 1) {
}
}
catch (e) {
}
shouldBe("for_val_part3_throw2","4");
// ---------------------------------
var for_val_part1_throwbody = 4;
try {
for (for_val_part1_throwbody = 1; ;) {
throwex();
}
}
catch (e) {
}
shouldBe("for_val_part1_throwbody","1");
// ---------------------------------
var for_val_part2_throwbody = 4;
try {
for (; for_val_part2_throwbody = 1; ) {
throwex();
}
}
catch (e) {
}
shouldBe("for_val_part2_throwbody","1");
// ---------------------------------
var for_val_part3_throwbody = 4;
try {
for (; ; for_val_part3_throwbody = 1) {
throwex();
}
}
catch (e) {
}
shouldBe("for_val_part3_throwbody","4");
// ---------------------------------
var forin_test_obj = new Object();
forin_test_obj.a = 1;
forin_test_obj.b = 2;
forin_test_obj.c = 3;
var forin_count = 4;
function forin_lexpr() {
// if (forincount == 1);
// throwex();
return new Object();
}
try {
for (throwex() in forin_test_obj) {
forin_count++;
}
}
catch (e) {
}
shouldBe("forin_count","4");
// ---------------------------------
var set_inside_with_throw = 4;
try {
with (throwex()) {
set_inside_with_throw = 1;
}
}
catch (e) {
}
shouldBe("set_inside_with_throw","4");
// ---------------------------------
var set_inside_with_cantconverttoobject = 4;
try {
with (undefined) {
print("FAIL. This message should not be displayed");
set_inside_with_cantconverttoobject = 1;
}
}
catch (e) {
}
shouldBe("set_inside_with_cantconverttoobject","4");
// ### test case, sw
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Except a lot of errors. They should all be caught and lead to PASS
testing throw() .......... Passed
testing throw() .......... Passed
ReferenceError .......... Passed
error propagation in functions .......... Passed
catch
finally
Math() error .......... Passed
Abort while() on error .......... Passed
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
function kdeShouldBe(a, b, c)
{
if ( a == b )
debug(c+" .......... Passed");
else
debug(c+" .......... Failed");
}
function testThrow()
{
var caught = false;
try {
throw 99;
} catch (e) {
caught = true;
}
kdeShouldBe(caught, true, "testing throw()");
}
// same as above but lacking a semicolon after throw
function testThrow2()
{
var caught = false;
try {
throw 99
} catch (e) {
caught = true;
}
kdeShouldBe(caught, true, "testing throw()");
}
function testReferenceError()
{
var err = "noerror";
var caught = false;
try {
var dummy = nonexistant; // throws reference error
} catch (e) {
caught = true;
err = e.name;
}
// test err
kdeShouldBe(caught, true, "ReferenceError");
}
function testFunctionErrorHelper()
{
var a = b; // throws reference error
}
function testFunctionError()
{
var caught = false;
try {
testFunctionErrorHelper();
} catch (e) {
caught = true;
}
kdeShouldBe(caught, true, "error propagation in functions");
}
function testMathFunctionError()
{
var caught = false;
try {
Math();
} catch (e) {
debug("catch");
caught = true;
} finally {
debug("finally");
}
kdeShouldBe(caught, true, "Math() error");
}
function testWhileAbortion()
{
var caught = 0;
try {
while (a=b, 1) {        // "endless error" in condition
;
}
} catch (e) {
caught++;
}
try {
while (1) {
var a = b;        // error in body
}
} catch (e) {
caught++;
}
kdeShouldBe(caught, 2, "Abort while() on error");
}
debug("Except a lot of errors. They should all be caught and lead to PASS");
testThrow();
testThrow2();
testReferenceError();
testFunctionError();
testMathFunctionError();
testWhileAbortion();
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Function declaration takes effect at entry
PASS Decl not yet overwritten
PASS After assign (0)
PASS function decls have no execution content
PASS After assign #2 (0)
PASS Decl already overwritten
PASS After assign (1)
PASS function decls have no execution content
PASS After assign #2 (1)
PASS Decl already overwritten
PASS After assign (2)
PASS function decls have no execution content
PASS After assign #2 (2)
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// We can't use normal shouldBe here, since they'd eval in the wrong context...
function shouldBeOfType(msg, val, type) {
if (typeof(val) != type)
testFailed(msg + ": value has type " + typeof(val) + " , not:" + type);
else
testPassed(msg);
}
function shouldBeVal(msg, val, expected) {
if (val != expected)
testFailed(msg + ": value is " + val + " , not:" + expected);
else
testPassed(msg);
}
f = "global";
function test() {
try {
shouldBeOfType("Function declaration takes effect at entry", f, "function");
}
catch (e) {
testFailed("Scoping very broken!");
}
for (var i = 0; i < 3; ++i) {
if (i == 0)
shouldBeOfType("Decl not yet overwritten", f, 'function');
else
shouldBeOfType("Decl already overwritten", f, 'number');
f = 3;
shouldBeVal("After assign ("+i+")", f, 3);
function f() {};
shouldBeVal("function decls have no execution content", f, 3);
f = 5;
shouldBeVal("After assign #2 ("+i+")", f, 5);
}
}
test();
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.prototype.toString.__proto__ is Function.prototype
PASS Object.prototype.valueOf.__proto__ is Function.prototype
PASS Array.prototype.toString.__proto__ is Function.prototype
PASS Array.prototype.toLocaleString.__proto__ is Function.prototype
PASS Array.prototype.concat.__proto__ is Function.prototype
PASS Array.prototype.join.__proto__ is Function.prototype
PASS Array.prototype.pop.__proto__ is Function.prototype
PASS Array.prototype.push.__proto__ is Function.prototype
PASS Array.prototype.reverse.__proto__ is Function.prototype
PASS Array.prototype.shift.__proto__ is Function.prototype
PASS Array.prototype.slice.__proto__ is Function.prototype
PASS Array.prototype.sort.__proto__ is Function.prototype
PASS Array.prototype.splice.__proto__ is Function.prototype
PASS Array.prototype.unshift.__proto__ is Function.prototype
PASS String.prototype.toString.__proto__ is Function.prototype
PASS String.prototype.valueOf.__proto__ is Function.prototype
PASS String.prototype.charAt.__proto__ is Function.prototype
PASS String.prototype.charCodeAt.__proto__ is Function.prototype
PASS String.prototype.indexOf.__proto__ is Function.prototype
PASS String.prototype.lastIndexOf.__proto__ is Function.prototype
PASS String.prototype.match.__proto__ is Function.prototype
PASS String.prototype.replace.__proto__ is Function.prototype
PASS String.prototype.search.__proto__ is Function.prototype
PASS String.prototype.slice.__proto__ is Function.prototype
PASS String.prototype.split.__proto__ is Function.prototype
PASS String.prototype.substr.__proto__ is Function.prototype
PASS String.prototype.substring.__proto__ is Function.prototype
PASS String.prototype.toLowerCase.__proto__ is Function.prototype
PASS String.prototype.toUpperCase.__proto__ is Function.prototype
PASS String.prototype.big.__proto__ is Function.prototype
PASS String.prototype.small.__proto__ is Function.prototype
PASS String.prototype.blink.__proto__ is Function.prototype
PASS String.prototype.bold.__proto__ is Function.prototype
PASS String.prototype.fixed.__proto__ is Function.prototype
PASS String.prototype.italics.__proto__ is Function.prototype
PASS String.prototype.strike.__proto__ is Function.prototype
PASS String.prototype.sub.__proto__ is Function.prototype
PASS String.prototype.sup.__proto__ is Function.prototype
PASS String.prototype.fontcolor.__proto__ is Function.prototype
PASS String.prototype.fontsize.__proto__ is Function.prototype
PASS String.prototype.anchor.__proto__ is Function.prototype
PASS String.prototype.link.__proto__ is Function.prototype
PASS Boolean.prototype.toString.__proto__ is Function.prototype
PASS Boolean.prototype.valueOf.__proto__ is Function.prototype
PASS Date.prototype.toString.__proto__ is Function.prototype
PASS Date.prototype.toUTCString.__proto__ is Function.prototype
PASS Date.prototype.toDateString.__proto__ is Function.prototype
PASS Date.prototype.toTimeString.__proto__ is Function.prototype
PASS Date.prototype.toLocaleString.__proto__ is Function.prototype
PASS Date.prototype.toLocaleDateString.__proto__ is Function.prototype
PASS Date.prototype.toLocaleTimeString.__proto__ is Function.prototype
PASS Date.prototype.valueOf.__proto__ is Function.prototype
PASS Date.prototype.getTime.__proto__ is Function.prototype
PASS Date.prototype.getFullYear.__proto__ is Function.prototype
PASS Date.prototype.getUTCFullYear.__proto__ is Function.prototype
PASS Date.prototype.toGMTString.__proto__ is Function.prototype
PASS Date.prototype.getMonth.__proto__ is Function.prototype
PASS Date.prototype.getUTCMonth.__proto__ is Function.prototype
PASS Date.prototype.getDate.__proto__ is Function.prototype
PASS Date.prototype.getUTCDate.__proto__ is Function.prototype
PASS Date.prototype.getDay.__proto__ is Function.prototype
PASS Date.prototype.getUTCDay.__proto__ is Function.prototype
PASS Date.prototype.getHours.__proto__ is Function.prototype
PASS Date.prototype.getUTCHours.__proto__ is Function.prototype
PASS Date.prototype.getMinutes.__proto__ is Function.prototype
PASS Date.prototype.getUTCMinutes.__proto__ is Function.prototype
PASS Date.prototype.getSeconds.__proto__ is Function.prototype
PASS Date.prototype.getUTCSeconds.__proto__ is Function.prototype
PASS Date.prototype.getMilliseconds.__proto__ is Function.prototype
PASS Date.prototype.getUTCMilliseconds.__proto__ is Function.prototype
PASS Date.prototype.getTimezoneOffset.__proto__ is Function.prototype
PASS Date.prototype.setTime.__proto__ is Function.prototype
PASS Date.prototype.setMilliseconds.__proto__ is Function.prototype
PASS Date.prototype.setUTCMilliseconds.__proto__ is Function.prototype
PASS Date.prototype.setSeconds.__proto__ is Function.prototype
PASS Date.prototype.setUTCSeconds.__proto__ is Function.prototype
PASS Date.prototype.setMinutes.__proto__ is Function.prototype
PASS Date.prototype.setUTCMinutes.__proto__ is Function.prototype
PASS Date.prototype.setHours.__proto__ is Function.prototype
PASS Date.prototype.setUTCHours.__proto__ is Function.prototype
PASS Date.prototype.setDate.__proto__ is Function.prototype
PASS Date.prototype.setUTCDate.__proto__ is Function.prototype
PASS Date.prototype.setMonth.__proto__ is Function.prototype
PASS Date.prototype.setUTCMonth.__proto__ is Function.prototype
PASS Date.prototype.setFullYear.__proto__ is Function.prototype
PASS Date.prototype.setUTCFullYear.__proto__ is Function.prototype
PASS Date.prototype.setYear.__proto__ is Function.prototype
PASS Date.prototype.getYear.__proto__ is Function.prototype
PASS Date.prototype.toGMTString.__proto__ is Function.prototype
PASS RegExp.prototype.exec.__proto__ is Function.prototype
PASS RegExp.prototype.test.__proto__ is Function.prototype
PASS RegExp.prototype.toString.__proto__ is Function.prototype
PASS Error.prototype.toString.__proto__ is Function.prototype
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
shouldBe("Object.prototype.toString.__proto__","Function.prototype");
shouldBe("Object.prototype.valueOf.__proto__","Function.prototype");
shouldBe("Array.prototype.toString.__proto__","Function.prototype");
shouldBe("Array.prototype.toLocaleString.__proto__","Function.prototype");
shouldBe("Array.prototype.concat.__proto__","Function.prototype");
shouldBe("Array.prototype.join.__proto__","Function.prototype");
shouldBe("Array.prototype.pop.__proto__","Function.prototype");
shouldBe("Array.prototype.push.__proto__","Function.prototype");
shouldBe("Array.prototype.reverse.__proto__","Function.prototype");
shouldBe("Array.prototype.shift.__proto__","Function.prototype");
shouldBe("Array.prototype.slice.__proto__","Function.prototype");
shouldBe("Array.prototype.sort.__proto__","Function.prototype");
shouldBe("Array.prototype.splice.__proto__","Function.prototype");
shouldBe("Array.prototype.unshift.__proto__","Function.prototype");
shouldBe("String.prototype.toString.__proto__","Function.prototype");
shouldBe("String.prototype.valueOf.__proto__","Function.prototype");
shouldBe("String.prototype.charAt.__proto__","Function.prototype");
shouldBe("String.prototype.charCodeAt.__proto__","Function.prototype");
shouldBe("String.prototype.indexOf.__proto__","Function.prototype");
shouldBe("String.prototype.lastIndexOf.__proto__","Function.prototype");
shouldBe("String.prototype.match.__proto__","Function.prototype");
shouldBe("String.prototype.replace.__proto__","Function.prototype");
shouldBe("String.prototype.search.__proto__","Function.prototype");
shouldBe("String.prototype.slice.__proto__","Function.prototype");
shouldBe("String.prototype.split.__proto__","Function.prototype");
shouldBe("String.prototype.substr.__proto__","Function.prototype");
shouldBe("String.prototype.substring.__proto__","Function.prototype");
shouldBe("String.prototype.toLowerCase.__proto__","Function.prototype");
shouldBe("String.prototype.toUpperCase.__proto__","Function.prototype");
shouldBe("String.prototype.big.__proto__","Function.prototype");
shouldBe("String.prototype.small.__proto__","Function.prototype");
shouldBe("String.prototype.blink.__proto__","Function.prototype");
shouldBe("String.prototype.bold.__proto__","Function.prototype");
shouldBe("String.prototype.fixed.__proto__","Function.prototype");
shouldBe("String.prototype.italics.__proto__","Function.prototype");
shouldBe("String.prototype.strike.__proto__","Function.prototype");
shouldBe("String.prototype.sub.__proto__","Function.prototype");
shouldBe("String.prototype.sup.__proto__","Function.prototype");
shouldBe("String.prototype.fontcolor.__proto__","Function.prototype");
shouldBe("String.prototype.fontsize.__proto__","Function.prototype");
shouldBe("String.prototype.anchor.__proto__","Function.prototype");
shouldBe("String.prototype.link.__proto__","Function.prototype");
shouldBe("Boolean.prototype.toString.__proto__","Function.prototype");
shouldBe("Boolean.prototype.valueOf.__proto__","Function.prototype");
shouldBe("Date.prototype.toString.__proto__","Function.prototype");
shouldBe("Date.prototype.toUTCString.__proto__","Function.prototype");
shouldBe("Date.prototype.toDateString.__proto__","Function.prototype");
shouldBe("Date.prototype.toTimeString.__proto__","Function.prototype");
shouldBe("Date.prototype.toLocaleString.__proto__","Function.prototype");
shouldBe("Date.prototype.toLocaleDateString.__proto__","Function.prototype");
shouldBe("Date.prototype.toLocaleTimeString.__proto__","Function.prototype");
shouldBe("Date.prototype.valueOf.__proto__","Function.prototype");
shouldBe("Date.prototype.getTime.__proto__","Function.prototype");
shouldBe("Date.prototype.getFullYear.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCFullYear.__proto__","Function.prototype");
shouldBe("Date.prototype.toGMTString.__proto__","Function.prototype");
shouldBe("Date.prototype.getMonth.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCMonth.__proto__","Function.prototype");
shouldBe("Date.prototype.getDate.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCDate.__proto__","Function.prototype");
shouldBe("Date.prototype.getDay.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCDay.__proto__","Function.prototype");
shouldBe("Date.prototype.getHours.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCHours.__proto__","Function.prototype");
shouldBe("Date.prototype.getMinutes.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCMinutes.__proto__","Function.prototype");
shouldBe("Date.prototype.getSeconds.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCSeconds.__proto__","Function.prototype");
shouldBe("Date.prototype.getMilliseconds.__proto__","Function.prototype");
shouldBe("Date.prototype.getUTCMilliseconds.__proto__","Function.prototype");
shouldBe("Date.prototype.getTimezoneOffset.__proto__","Function.prototype");
shouldBe("Date.prototype.setTime.__proto__","Function.prototype");
shouldBe("Date.prototype.setMilliseconds.__proto__","Function.prototype");
shouldBe("Date.prototype.setUTCMilliseconds.__proto__","Function.prototype");
shouldBe("Date.prototype.setSeconds.__proto__","Function.prototype");
shouldBe("Date.prototype.setUTCSeconds.__proto__","Function.prototype");
shouldBe("Date.prototype.setMinutes.__proto__","Function.prototype");
shouldBe("Date.prototype.setUTCMinutes.__proto__","Function.prototype");
shouldBe("Date.prototype.setHours.__proto__","Function.prototype");
shouldBe("Date.prototype.setUTCHours.__proto__","Function.prototype");
shouldBe("Date.prototype.setDate.__proto__","Function.prototype");
shouldBe("Date.prototype.setUTCDate.__proto__","Function.prototype");
shouldBe("Date.prototype.setMonth.__proto__","Function.prototype");
shouldBe("Date.prototype.setUTCMonth.__proto__","Function.prototype");
shouldBe("Date.prototype.setFullYear.__proto__","Function.prototype");
shouldBe("Date.prototype.setUTCFullYear.__proto__","Function.prototype");
shouldBe("Date.prototype.setYear.__proto__","Function.prototype");
shouldBe("Date.prototype.getYear.__proto__","Function.prototype");
shouldBe("Date.prototype.toGMTString.__proto__","Function.prototype");
shouldBe("RegExp.prototype.exec.__proto__","Function.prototype");
shouldBe("RegExp.prototype.test.__proto__","Function.prototype");
shouldBe("RegExp.prototype.toString.__proto__","Function.prototype");
shouldBe("Error.prototype.toString.__proto__","Function.prototype");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS count is 10
PASS count is 5
PASS count is 10
PASS properties is 'a=11;b=22;'
PASS list is '[0]=100;[1]=101;'
PASS list is '123'
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
// 12.6.1
var count = 0;
do {
count++;
} while (count < 10);
shouldBe("count", "10");
count = 0;
for (var i = 0; i < 10; i++) {
if (i == 5)
break;
count++;
}
shouldBe("count", "5");
// 12.6.3
count = 0;
for (i = 0; i < 10; i++) {
count++;
}
shouldBe("count", "10");
// 12.6.4
obj = new Object();
obj.a = 11;
obj.b = 22;
properties = "";
for ( prop in obj )
properties += (prop + "=" + obj[prop] + ";");
shouldBe("properties", "'a=11;b=22;'");
// now a test verifying the order. not standardized but common.
obj.y = 33;
obj.x = 44;
properties = "";
for ( prop in obj )
properties += prop;
// shouldBe("properties", "'abyx'");
arr = new Array;
arr[0] = 100;
arr[1] = 101;
list = "";
for ( var j in arr ) {
list += "[" + j + "]=" + arr[j] + ";";
}
shouldBe("list","'[0]=100;[1]=101;'");
list = "";
for (var a = [1,2,3], length = a.length, i = 0; i < length; i++) {
list += a[i];
}
shouldBe("list", "'123'");
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
<!-- HTML comment (not ECMA)
\ No newline at end of file
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
// 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("KDE JS Test");
--> end of HTML comment (not ECMA)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# 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.
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS MD5('kde') is '186cf28b76f2264e9fea8fcf91cb4f5d'
PASS successfullyParsed is true
TEST COMPLETE
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment