mirror of https://github.com/tc39/test262.git
Fix tests
This commit is contained in:
parent
78dbc401b1
commit
2778324491
|
@ -21,7 +21,7 @@ info: |
|
|||
---*/
|
||||
|
||||
var value = 0n;
|
||||
assert.sameValue(value &&= 1n, "test", "(value &&= 1n) === 0n; where value = 0n");
|
||||
assert.sameValue(value &&= 1n, 0n, "(value &&= 1n) === 0n; where value = 0n");
|
||||
|
||||
var value = 2n;
|
||||
assert.sameValue(value &&= 1n, "test", "(value &&= 1n) === 1n; where value = 2n");
|
||||
value = 2n;
|
||||
assert.sameValue(value &&= 1n, 1n, "(value &&= 1n) === 1n; where value = 2n");
|
||||
|
|
|
@ -23,7 +23,7 @@ assert.throws(DummyError, function() {
|
|||
base[prop()] &&= expr();
|
||||
});
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
var base = null;
|
||||
var prop = {
|
||||
toString: function() {
|
||||
|
|
|
@ -22,7 +22,7 @@ Object.defineProperty(obj, "prop", {
|
|||
configurable: true
|
||||
});
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop &&= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, 2, "obj.prop");
|
||||
|
|
|
@ -20,7 +20,7 @@ Object.defineProperty(obj, "prop", {
|
|||
configurable: true
|
||||
});
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop &&= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, 2, "obj.prop");
|
||||
|
|
|
@ -20,7 +20,7 @@ info: |
|
|||
---*/
|
||||
|
||||
var value = 0n;
|
||||
assert.sameValue(value ??= 1n, "test", "(value ??= 1n) === 0n; where value = 0n");
|
||||
assert.sameValue(value ??= 1n, 0n, "(value ??= 1n) === 0n; where value = 0n");
|
||||
|
||||
var value = 2n;
|
||||
assert.sameValue(value ??= 1n, "test", "(value ??= 1n) === 2n; where value = 2n");
|
||||
value = 2n;
|
||||
assert.sameValue(value ??= 1n, 2n, "(value ??= 1n) === 2n; where value = 2n");
|
||||
|
|
|
@ -23,7 +23,7 @@ assert.throws(DummyError, function() {
|
|||
base[prop()] ??= expr();
|
||||
});
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
var base = null;
|
||||
var prop = {
|
||||
toString: function() {
|
||||
|
@ -45,9 +45,9 @@ function incr() {
|
|||
|
||||
assert.sameValue(obj[incr()] ??= incr(), 2, "obj[incr()] ??= incr()");
|
||||
assert.sameValue(obj[1], 2, "obj[1]");
|
||||
assert.sameValue(count, 1, "count");
|
||||
assert.sameValue(count, 2, "count");
|
||||
|
||||
obj[2] = 1;
|
||||
assert.sameValue(obj[incr()] ??= incr(), 3, "obj[incr()] ??= incr()");
|
||||
obj[3] = 1;
|
||||
assert.sameValue(obj[incr()] ??= incr(), 1, "obj[incr()] ??= incr()");
|
||||
assert.sameValue(obj[3], 1, "obj[3]");
|
||||
assert.sameValue(count, 3, "count");
|
||||
|
|
|
@ -22,7 +22,7 @@ Object.defineProperty(obj, "prop", {
|
|||
configurable: true
|
||||
});
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop ??= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, undefined, "obj.prop");
|
||||
|
|
|
@ -15,7 +15,7 @@ features: [logical-assignment-operators]
|
|||
var obj = {};
|
||||
Object.preventExtensions(obj);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop ??= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, undefined, "obj.prop");
|
||||
|
|
|
@ -20,7 +20,7 @@ Object.defineProperty(obj, "prop", {
|
|||
configurable: true
|
||||
});
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop ??= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, undefined, "obj.prop");
|
||||
|
|
|
@ -21,7 +21,7 @@ info: |
|
|||
---*/
|
||||
|
||||
var value = 0n;
|
||||
assert.sameValue(value ||= 1n, "test", "(value ||= 1n) === 1n; where value = 0n");
|
||||
assert.sameValue(value ||= 1n, 1n, "(value ||= 1n) === 1n; where value = 0n");
|
||||
|
||||
var value = 2n;
|
||||
assert.sameValue(value ||= 1n, "test", "(value ||= 1n) === 2n; where value = 2n");
|
||||
value = 2n;
|
||||
assert.sameValue(value ||= 1n, 2n, "(value ||= 1n) === 2n; where value = 2n");
|
||||
|
|
|
@ -23,7 +23,7 @@ assert.throws(DummyError, function() {
|
|||
base[prop()] ||= expr();
|
||||
});
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
var base = null;
|
||||
var prop = {
|
||||
toString: function() {
|
||||
|
|
|
@ -22,7 +22,7 @@ Object.defineProperty(obj, "prop", {
|
|||
configurable: true
|
||||
});
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop ||= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, 0, "obj.prop");
|
||||
|
|
|
@ -15,7 +15,7 @@ features: [logical-assignment-operators]
|
|||
var obj = {};
|
||||
Object.preventExtensions(obj);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop ||= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, undefined, "obj.prop");
|
||||
|
|
|
@ -20,7 +20,7 @@ Object.defineProperty(obj, "prop", {
|
|||
configurable: true
|
||||
});
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
assert.throws(TypeError, function() {
|
||||
obj.prop ||= 1;
|
||||
});
|
||||
assert.sameValue(obj.prop, 0, "obj.prop");
|
||||
|
|
Loading…
Reference in New Issue