mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
451 B
26 lines
451 B
/*
|
|
* E5 Section 15.10.6 requires a TypeError if RegExp.prototype methods
|
|
* are called with a 'this' value which is not a RegExp.
|
|
*/
|
|
|
|
/*===
|
|
TypeError
|
|
TypeError
|
|
TypeError
|
|
===*/
|
|
|
|
var funcs = [
|
|
RegExp.prototype.exec,
|
|
RegExp.prototype.test,
|
|
RegExp.prototype.toString,
|
|
];
|
|
|
|
for (var i = 0; i < funcs.length; i++) {
|
|
var f = funcs[i];
|
|
try {
|
|
f('foo');
|
|
print('no error');
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
}
|
|
|