mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Add tests for bug 352085, bug 472534, bug 496985, bug 566661, and bug 350712. rs=jwalden
--HG-- extra : rebase_source : eacda0a882d754d4210940625ee7fd3a7c446610
This commit is contained in:
parent
32dfb1669c
commit
f7fd8ab3b7
17
js/src/tests/ecma_5/extensions/bug352085.js
Normal file
17
js/src/tests/ecma_5/extensions/bug352085.js
Normal file
@ -0,0 +1,17 @@
|
||||
var a = function (t) {
|
||||
return t % 0;
|
||||
}
|
||||
|
||||
var b = function (t) {
|
||||
return t % "";
|
||||
}
|
||||
|
||||
var c = function (t) {
|
||||
return t % ("" + "");
|
||||
}
|
||||
|
||||
assertEq(a.toString(), b.toString());
|
||||
assertEq(a.toString(), c.toString());
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
30
js/src/tests/ecma_5/extensions/bug472534.js
Normal file
30
js/src/tests/ecma_5/extensions/bug472534.js
Normal file
@ -0,0 +1,30 @@
|
||||
function monthNames () {
|
||||
return [
|
||||
/jan(uar(y)?)?/, 0,
|
||||
/feb(ruar(y)?)?/, 1,
|
||||
/m\u00e4r|mar|m\u00e4rz|maerz|march/, 2,
|
||||
/apr(il)?/, 3,
|
||||
/ma(i|y)/, 4,
|
||||
/jun(i|o|e)?/, 5,
|
||||
/jul(i|y)?/, 6,
|
||||
/aug(ust)?/, 7,
|
||||
/sep((t)?(ember))?/, 8,
|
||||
/o(c|k)t(ober)?/, 9,
|
||||
/nov(ember)?/, 10,
|
||||
/de(c|z)(ember)?/, 11
|
||||
];
|
||||
};
|
||||
|
||||
var actual = '';
|
||||
var expected = '(jan(uar(y)?)?)|(feb(ruar(y)?)?)|(m\\u00e4r|mar|m\\u00e4rz|maerz|march)|(apr(il)?)|(ma(i|y))|(jun(i|o|e)?)|(jul(i|y)?)|(aug(ust)?)|(sep((t)?(ember))?)|(o(c|k)t(ober)?)|(nov(ember)?)|(de(c|z)(ember)?)';
|
||||
var mn = monthNames();
|
||||
for (var i = 0; i < mn.length; ++i) {
|
||||
if (actual)
|
||||
actual += '|';
|
||||
actual += '(' + mn[i++].source + ')';
|
||||
}
|
||||
|
||||
assertEq(actual, expected);
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
12
js/src/tests/ecma_5/extensions/bug496985.js
Normal file
12
js/src/tests/ecma_5/extensions/bug496985.js
Normal file
@ -0,0 +1,12 @@
|
||||
var a = function() {
|
||||
return function ({x: arguments}) {
|
||||
return arguments;
|
||||
}
|
||||
}
|
||||
var b = eval(uneval(a));
|
||||
|
||||
assertEq(a()({x: 1}), 1);
|
||||
assertEq(b()({x: 1}), 1);
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
6
js/src/tests/ecma_5/extensions/bug566661.js
Normal file
6
js/src/tests/ecma_5/extensions/bug566661.js
Normal file
@ -0,0 +1,6 @@
|
||||
var f = function (q) { return q['\xC7']; }
|
||||
var d = eval(uneval(f));
|
||||
assertEq(d({'\xC7': 'good'}), 'good');
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
20
js/src/tests/ecma_5/extensions/iterator-in-catch.js
Normal file
20
js/src/tests/ecma_5/extensions/iterator-in-catch.js
Normal file
@ -0,0 +1,20 @@
|
||||
//Bug 350712
|
||||
|
||||
function iterator () {
|
||||
for (var i in []);
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
throw 5;
|
||||
}
|
||||
catch(error if iterator()) {
|
||||
assertEq(false, true);
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
assertEq(error, 5);
|
||||
}
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
@ -16,3 +16,8 @@ script eval-native-callback-is-indirect.js
|
||||
script regress-bug607284.js
|
||||
script Object-keys-and-object-ids.js
|
||||
fails script nested-delete-name-in-evalcode.js # bug 604301, at a minimum
|
||||
script bug352085.js
|
||||
script bug472534.js
|
||||
script bug496985.js
|
||||
script bug566661.js
|
||||
script iterator-in-catch.js
|
||||
|
Loading…
Reference in New Issue
Block a user