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:
Mike Pennisi 2018-06-10 19:21:12 -04:00 committed by Rick Waldron
parent 0618779cb8
commit a9cd42018f
16 changed files with 32 additions and 32 deletions

View File

@ -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();

View File

@ -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();
});
}

View File

@ -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();
});

View File

@ -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();

View File

@ -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();
});

View File

@ -10,8 +10,8 @@ flags: [noStrict]
---*/
(function () {
eval("var public = 1;");
test262unresolvable = null;
"use strict";
assert.sameValue(public, 1);
assert.sameValue(test262unresolvable, null);
}) ();

View File

@ -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();

View File

@ -9,8 +9,8 @@ description: >
flags: [noStrict]
---*/
assert.throws(SyntaxError, function() {
assert.throws(ReferenceError, function() {
"use strict"
eval("var public = 1;");
test262unresolvable = null;
});

View File

@ -10,7 +10,7 @@ flags: [noStrict]
---*/
(function () {
eval("var public = 1;");
assert.sameValue(public, 1);
test262unresolvable = null;
assert.sameValue(test262unresolvable, null);
"use strict";
}) ();

View File

@ -9,8 +9,8 @@ description: >
flags: [noStrict]
---*/
assert.throws(SyntaxError, function () {
assert.throws(ReferenceError, function () {
"use strict";
eval("var public = 1;");
test262unresolvable = null;
});

View File

@ -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;
}
});

View File

@ -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);

View File

@ -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;
}
});

View File

@ -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;
}
});

View File

@ -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;
}
});

View File

@ -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;
}
});