mirror of https://github.com/tc39/test262.git
Tests for spec violation generically by enumerating properties.
This commit is contained in:
parent
ede572eced
commit
eea2f45421
|
@ -11,12 +11,22 @@
|
|||
* @onlyStrict
|
||||
*/
|
||||
"use strict";
|
||||
var deleted = 'unassigned';
|
||||
try {
|
||||
deleted = delete RegExp.leftContext;
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
if (deleted === false) {
|
||||
$ERROR('Strict delete returned false');
|
||||
var reNames = Object.getOwnPropertyNames(RegExp);
|
||||
for (var i = 0, len = reNames.length; i < len; i++) {
|
||||
var reName = reNames[i];
|
||||
if (reName !== 'prototype') {
|
||||
var deleted = 'unassigned';
|
||||
try {
|
||||
deleted = delete RegExp[reName];
|
||||
} catch (err) {
|
||||
if (!(err instanceof TypeError)) {
|
||||
$ERROR('#1: strict delete threw a non-TypeError: ' + err);
|
||||
}
|
||||
// fall through
|
||||
}
|
||||
if (deleted === false) {
|
||||
$ERROR('#2: Strict delete returned false');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue