mirror of https://github.com/tc39/test262.git
Simplify tests for runtime semantics
Verify runtime semantics through assignment to an unresolvable reference, reducing the complexity of tests that previously relied on the semantics of the `eval` function.
This commit is contained in:
parent
0618779cb8
commit
a9cd42018f
|
@ -9,8 +9,8 @@ description: >
|
|||
flags: [noStrict]
|
||||
---*/
|
||||
function fun() {
|
||||
eval("var public = 1;");
|
||||
assert.sameValue(public, 1);
|
||||
test262unresolvable = null;
|
||||
assert.sameValue(test262unresolvable, null);
|
||||
"use strict";
|
||||
}
|
||||
fun();
|
||||
|
|
|
@ -13,10 +13,10 @@ flags: [noStrict]
|
|||
function testcase() {
|
||||
"use strict";
|
||||
function fun() {
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
fun();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -12,9 +12,9 @@ flags: [noStrict]
|
|||
|
||||
function fun() {
|
||||
"use strict"
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
fun();
|
||||
});
|
||||
|
|
|
@ -10,8 +10,8 @@ flags: [noStrict]
|
|||
---*/
|
||||
|
||||
function fun() {
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
"use strict";
|
||||
assert.sameValue(public, 1);
|
||||
assert.sameValue(test262unresolvable, null);
|
||||
}
|
||||
fun();
|
||||
|
|
|
@ -12,9 +12,9 @@ flags: [noStrict]
|
|||
function fun() {
|
||||
"use strict";
|
||||
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
fun();
|
||||
});
|
||||
|
|
|
@ -10,8 +10,8 @@ flags: [noStrict]
|
|||
---*/
|
||||
|
||||
(function () {
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
"use strict";
|
||||
|
||||
assert.sameValue(public, 1);
|
||||
assert.sameValue(test262unresolvable, null);
|
||||
}) ();
|
||||
|
|
|
@ -13,8 +13,8 @@ flags: [noStrict]
|
|||
function testcase() {
|
||||
"use strict";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var public = 1;");
|
||||
assert.throws(ReferenceError, function() {
|
||||
test262unresolvable = null;
|
||||
});
|
||||
}
|
||||
testcase();
|
||||
|
|
|
@ -9,8 +9,8 @@ description: >
|
|||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
"use strict"
|
||||
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@ flags: [noStrict]
|
|||
---*/
|
||||
|
||||
(function () {
|
||||
eval("var public = 1;");
|
||||
assert.sameValue(public, 1);
|
||||
test262unresolvable = null;
|
||||
assert.sameValue(test262unresolvable, null);
|
||||
"use strict";
|
||||
}) ();
|
||||
|
|
|
@ -9,8 +9,8 @@ description: >
|
|||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
assert.throws(SyntaxError, function () {
|
||||
assert.throws(ReferenceError, function () {
|
||||
"use strict";
|
||||
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
});
|
||||
|
|
|
@ -10,12 +10,12 @@ description: >
|
|||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
"use strict";
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "accProperty", {
|
||||
get: function () {
|
||||
eval("public = 1;");
|
||||
test262unresolvable = null;
|
||||
return 11;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -13,11 +13,11 @@ flags: [noStrict]
|
|||
var obj = {};
|
||||
Object.defineProperty(obj, "accProperty", {
|
||||
get: function () {
|
||||
eval("public = 1;");
|
||||
test262unresolvable = null;
|
||||
"use strict";
|
||||
return 11;
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(obj.accProperty, 11, 'obj.accProperty');
|
||||
assert.sameValue(public, 1, 'public');
|
||||
assert.sameValue(test262unresolvable, null);
|
||||
|
|
|
@ -11,12 +11,12 @@ flags: [noStrict]
|
|||
---*/
|
||||
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "accProperty", {
|
||||
get: function () {
|
||||
"use strict";
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
return 11;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,13 +12,13 @@ flags: [noStrict]
|
|||
|
||||
var data = "data";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
"use strict";
|
||||
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "accProperty", {
|
||||
set: function (value) {
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
data = value;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,12 +12,12 @@ flags: [noStrict]
|
|||
|
||||
var data = "data";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "accProperty", {
|
||||
set: function (value) {
|
||||
"use strict";
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
data = value;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,12 +12,12 @@ flags: [noStrict]
|
|||
---*/
|
||||
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
assert.throws(ReferenceError, function() {
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "accProperty", {
|
||||
set: function () {
|
||||
"use strict";
|
||||
eval("var public = 1;");
|
||||
test262unresolvable = null;
|
||||
return 11;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue