Fix multiple test errors

Tests doesn't use async functionality and don't call $DONE, so remove
"async" flag:
- src/params/error/async-gen-named-func-expr.template
- test/language/expressions/async-generator/params-named-dflt-abrupt.js
- test/language/expressions/async-generator/params-named-dflt-ref-later.js
- test/language/expressions/async-generator/params-named-dflt-ref-self.js

Intl.PluralRules.prototype is no longer a Intl.Prototype instance:
- test/intl402/PluralRules/prototype/prototype.js

Intl.PluralRules throws an error when called as a function:
- test/intl402/PluralRules/undefined-newtarget-throws.js

Module namespace objects call OrdinaryDelete for symbol properties:
- test/language/module-code/namespace/internals/delete-non-exported.js

Async generators no longer retrieves "done" property twice:
- src/async-generators/yield-star-async-next.case
- src/async-generators/yield-star-async-return.case
- src/async-generators/yield-star-async-throw.case

Minor units of CLF is 4, so we need to test with maximumFractionDigits=3
to get an error:
- test/intl402/NumberFormat/dft-currency-mnfd-range-check-mxfd.js

DateTimeFormat.prototype.formatToParts length property was changed from
0 to 1:
- test/intl402/DateTimeFormat/prototype/formatToParts/length.js

minimumSignificantDigits and maximumSignificantDigits properties are
only retrieved once:
- test/intl402/NumberFormat/11.1.1_32.js
This commit is contained in:
André Bargull 2017-04-05 19:34:37 +02:00 committed by Leo Balter
parent ef7b99970b
commit 3291704eb2
No known key found for this signature in database
GPG Key ID: 2C75F319D398E36B
14 changed files with 146 additions and 175 deletions

View File

@ -14,16 +14,15 @@ YieldExpression: yield * AssignmentExpression
5. Let received be NormalCompletion(undefined).
6. Repeat
a. If received.[[Type]] is normal, then
i. Let innerResult be ? IteratorNext(iterator, received.[[Value]]).
ii. Let innerResult be ? Invoke(iterator, "next",
« received.[[Value]] »).
iii. If generatorKind is async, then set innerResult to
? Await(innerResult).
i. Let innerResult be ? Invoke(iterator, "next", « received.[[Value]] »).
ii. If generatorKind is async, then set innerResult to ? Await(innerResult).
...
v. Let done be ? IteratorComplete(innerResult).
vi. If done is true, then
1. Return ? IteratorValue(innerResult).
vii. Let received be GeneratorYield(innerResult).
iv. Let done be ? IteratorComplete(innerResult).
v. If done is true, then
1. Let resultValue be ? IteratorValue(innerResult).
2. If generatorKind is async, then set resultValue to ? Await(resultValue).
3. Return resultValue.
vi. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
...
GetIterator ( obj [ , hint ] )
@ -37,13 +36,10 @@ YieldExpression: yield * AssignmentExpression
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
...
GeneratorYield ( iterNextObj )
AsyncGeneratorYield ( value )
...
10. If generatorKind is async,
a. Let value be IteratorValue(iterNextObj).
b. Let done be IteratorComplete(iterNextObj).
c. Return ! AsyncGeneratorResolve(generator, value, done).
8. Return ! AsyncGeneratorResolve(generator, value, false).
...
flags: [async]
@ -206,44 +202,41 @@ iter.next("next-arg-1").then(v => {
assert.sameValue(log[8].name, "get next value (1)");
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
assert.sameValue(log[9].name, "get next done (1)");
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
assert.sameValue(v.value, "next-value-1");
assert.sameValue(v.done, false);
assert.sameValue(log.length, 10, "log.length");
assert.sameValue(log.length, 9, "log.length");
iter.next("next-arg-2").then(v => {
assert.sameValue(log[10].name, "get next");
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
assert.sameValue(log[9].name, "get next");
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
assert.sameValue(log[11].name, "call next");
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
assert.sameValue(log[11].args.length, 1, "next args.length");
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
assert.sameValue(log[10].name, "call next");
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
assert.sameValue(log[10].args.length, 1, "next args.length");
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
assert.sameValue(log[12].name, "get next then (2)");
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
assert.sameValue(log[11].name, "get next then (2)");
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
assert.sameValue(log[13].name, "call next then (2)");
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
assert.sameValue(log[13].args.length, 2, "next then args.length");
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
assert.sameValue(log[12].name, "call next then (2)");
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
assert.sameValue(log[12].args.length, 2, "next then args.length");
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
assert.sameValue(log[14].name, "get next done (2)");
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
assert.sameValue(log[13].name, "get next done (2)");
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
assert.sameValue(log[15].name, "get next value (2)");
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
assert.sameValue(log[14].name, "get next value (2)");
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
assert.sameValue(log[16].name, "after yield*");
assert.sameValue(log[16].value, "next-value-2");
assert.sameValue(log[15].name, "after yield*");
assert.sameValue(log[15].value, "next-value-2");
assert.sameValue(v.value, "return-value");
assert.sameValue(v.done, true);
assert.sameValue(log.length, 17, "log.length");
assert.sameValue(log.length, 16, "log.length");
}).then($DONE, $DONE);
}).catch($DONE);

View File

@ -14,27 +14,21 @@ info: |
i. Assert: received.[[Type]] is return.
ii. Let return be ? GetMethod(iterator, "return").
iii. If return is undefined, return Completion(received).
iv. Let innerReturnResult be ? Call(return, iterator,
« received.[[Value]] »).
v. If generatorKind is async, then set innerReturnResult to
? Await(innerReturnResult).
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
...
vii. Let done be ? IteratorComplete(innerReturnResult).
viii. If done is true, then
1. Let value be ? IteratorValue(innerReturnResult).
2. Return Completion{[[Type]]: return, [[Value]]: value,
[[Target]]: empty}.
ix. Let received be GeneratorYield(innerResult).
GeneratorYield ( iterNextObj )
2. If generatorKind is async, then set value to ? Await(value).
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
...
AsyncGeneratorYield ( value )
...
10. If generatorKind is async,
a. Let value be IteratorValue(iterNextObj).
b. Let done be IteratorComplete(iterNextObj).
c. Return ! AsyncGeneratorResolve(generator, value, done).
8. Return ! AsyncGeneratorResolve(generator, value, false).
...
flags: [async]
features: [async-iteration, Symbol.asyncIterator]
---*/
@ -186,42 +180,39 @@ iter.next().then(v => {
assert.sameValue(log[7].name, "get return value (1)");
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
assert.sameValue(log[8].name, "get return done (1)");
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
assert.sameValue(v.value, "return-value-1");
assert.sameValue(v.done, false);
assert.sameValue(log.length, 9, "log.length");
assert.sameValue(log.length, 8, "log.length");
iter.return("return-arg-2").then(v => {
assert.sameValue(log[9].name, "get return");
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
assert.sameValue(log[8].name, "get return");
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
assert.sameValue(log[10].name, "call return");
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
assert.sameValue(log[10].args.length, 1, "return args.length");
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
assert.sameValue(log[9].name, "call return");
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
assert.sameValue(log[9].args.length, 1, "return args.length");
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
assert.sameValue(log[11].name, "get return then (2)");
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
assert.sameValue(log[10].name, "get return then (2)");
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
assert.sameValue(log[12].name, "call return then (2)");
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
assert.sameValue(log[12].args.length, 2, "return then args.length");
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
assert.sameValue(log[11].name, "call return then (2)");
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
assert.sameValue(log[11].args.length, 2, "return then args.length");
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
assert.sameValue(log[13].name, "get return done (2)");
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
assert.sameValue(log[12].name, "get return done (2)");
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
assert.sameValue(log[14].name, "get return value (2)");
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
assert.sameValue(log[13].name, "get return value (2)");
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
assert.sameValue(v.value, "return-value-2");
assert.sameValue(v.done, true);
assert.sameValue(log.length, 15, "log.length");
assert.sameValue(log.length, 14, "log.length");
}).then($DONE, $DONE);
}).catch($DONE);
}).catch($DONE);

View File

@ -14,22 +14,20 @@ info: |
i. Let throw be ? GetMethod(iterator, "throw").
ii. If throw is not undefined, then
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
2. If generatorKind is async, then set innerResult to
? Await(innerResult).
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
...
5. Let done be ? IteratorComplete(innerResult).
6. If done is true, then
a. Return ? IteratorValue(innerResult).
7. Let received be GeneratorYield(innerResult).
a. Let resultValue be Return ? IteratorValue(innerResult).
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
c. Return resultValue.
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
...
GeneratorYield ( iterNextObj )
AsyncGeneratorYield ( value )
...
10. If generatorKind is async,
a. Let value be IteratorValue(iterNextObj).
b. Let done be IteratorComplete(iterNextObj).
c. Return ! AsyncGeneratorResolve(generator, value, done).
8. Return ! AsyncGeneratorResolve(generator, value, false).
...
flags: [async]
@ -188,45 +186,42 @@ iter.next().then(v => {
assert.sameValue(log[7].name, "get throw value (1)");
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
assert.sameValue(log[8].name, "get throw done (1)");
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
assert.sameValue(v.value, "throw-value-1");
assert.sameValue(v.done, false);
assert.sameValue(log.length, 9, "log.length");
assert.sameValue(log.length, 8, "log.length");
iter.throw("throw-arg-2").then(v => {
assert.sameValue(log[9].name, "get throw");
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
assert.sameValue(log[8].name, "get throw");
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
assert.sameValue(log[10].name, "call throw");
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
assert.sameValue(log[10].args.length, 1, "throw args.length");
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
assert.sameValue(log[9].name, "call throw");
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
assert.sameValue(log[9].args.length, 1, "throw args.length");
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
assert.sameValue(log[11].name, "get throw then (2)");
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
assert.sameValue(log[10].name, "get throw then (2)");
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
assert.sameValue(log[12].name, "call throw then (2)");
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
assert.sameValue(log[12].args.length, 2, "throw then args.length");
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
assert.sameValue(log[11].name, "call throw then (2)");
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
assert.sameValue(log[11].args.length, 2, "throw then args.length");
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
assert.sameValue(log[13].name, "get throw done (2)");
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
assert.sameValue(log[12].name, "get throw done (2)");
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
assert.sameValue(log[14].name, "get throw value (2)");
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
assert.sameValue(log[13].name, "get throw value (2)");
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
assert.sameValue(log[15].name, "after yield*");
assert.sameValue(log[15].value, "throw-value-2");
assert.sameValue(log[14].name, "after yield*");
assert.sameValue(log[14].value, "throw-value-2");
assert.sameValue(v.value, "return-value");
assert.sameValue(v.done, true);
assert.sameValue(log.length, 16, "log.length");
assert.sameValue(log.length, 15, "log.length");
}).then($DONE, $DONE);
}).catch($DONE);
}).catch($DONE);

View File

@ -13,7 +13,6 @@ info: |
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
AsyncGeneratorBody, funcEnv, strict).
[...]
flags: [async]
features: [async-iteration]
---*/

View File

@ -6,7 +6,7 @@ description: Intl.DateTimeFormat.prototype.formatToParts.length.
includes: [propertyHelper.js]
---*/
assert.sameValue(Intl.DateTimeFormat.prototype.formatToParts.length, 0);
assert.sameValue(Intl.DateTimeFormat.prototype.formatToParts.length, 1);
verifyNotEnumerable(Intl.DateTimeFormat.prototype.formatToParts, "length");
verifyNotWritable(Intl.DateTimeFormat.prototype.formatToParts, "length");

View File

@ -9,28 +9,23 @@ description: >
author: Norbert Lindenberg
---*/
var read = 0;
var minimumSignificantDigitsRead = false;
var maximumSignificantDigitsRead = false;
function readMinimumSignificantDigits() {
++read;
if (read === 1) {
return 0; // invalid value, but on first read that's OK
} else if (read === 3) {
return 1; // valid value
} else {
$ERROR("minimumSignificantDigits read out of sequence: " + read + ".");
}
assert.sameValue(minimumSignificantDigitsRead, false,
"minimumSignificantDigits getter already called");
assert.sameValue(maximumSignificantDigitsRead, false,
"maximumSignificantDigits getter called before minimumSignificantDigits");
minimumSignificantDigitsRead = true;
return 1;
}
function readMaximumSignificantDigits() {
++read;
if (read === 2) {
return 0; // invalid value, but on first read that's OK
} else if (read === 4) {
return 1; // valid value
} else {
$ERROR("maximumSignificantDigits read out of sequence: " + read + ".");
}
assert.sameValue(maximumSignificantDigitsRead, false,
"maximumSignificantDigits getter already called");
maximumSignificantDigitsRead = true;
return 1;
}
var options = {};
@ -41,6 +36,5 @@ Object.defineProperty(options, "maximumSignificantDigits",
new Intl.NumberFormat("de", options);
if (read !== 4) {
$ERROR("insuffient number of property reads: " + read + ".");
}
assert(minimumSignificantDigitsRead, "minimumSignificantDigits getter was called once");
assert(maximumSignificantDigitsRead, "maximumSignificantDigits getter was called once");

View File

@ -17,5 +17,5 @@ assert.throws(RangeError, () => new Intl.NumberFormat('en', {
assert.throws(RangeError, () => new Intl.NumberFormat('en', {
style: 'currency',
currency: 'CLF',
maximumFractionDigits: 4
}), 'CurrencyDigits(CLF) == 4');
maximumFractionDigits: 3
}), 'CurrencyDigits(CLF) == 3');

View File

@ -4,14 +4,13 @@
/*---
esid: sec-properties-of-intl-pluralrules-prototype-object
description: >
Tests that Intl.PluralRules.prototype is an object that has been
Tests that Intl.PluralRules.prototype is not an object that has been
initialized as an Intl.PluralRules.
author: Zibi Braniecki
---*/
// test by calling a function that would fail if "this" were not an object
// test by calling a function that fails if "this" is not an object
// initialized as an Intl.PluralRules
if (typeof Intl.PluralRules.prototype.select(0) !== "string") {
$ERROR("Intl.PluralRules's prototype is not an object that has been " +
"initialized as an Intl.PluralRules");
}
assert.throws(TypeError, function() {
Intl.PluralRules.prototype.select(0);
}, "Intl.PluralRules.prototype is not an object that has been initialized as an Intl.PluralRules");

View File

@ -1,29 +0,0 @@
// Copyright 2016 Mozilla Corporation. All rights reserved.
// This code is governed by the license found in the LICENSE file.
/*---
esid: sec-Intl.PluralRules
description: Tests that the this-value is ignored in PluralRules
author: Zibi Braniecki
includes: [testIntl.js]
---*/
testWithIntlConstructors(function (Constructor) {
var obj, newObj;
// variant 1: use constructor in a "new" expression
obj = new Constructor();
newObj = Intl.PluralRules.call(obj);
if (obj === newObj) {
$ERROR("PluralRules object created with \"new\" was not ignored as this-value.");
}
// variant 2: use constructor as a function
obj = Constructor();
newObj = Intl.PluralRules.call(obj);
if (obj === newObj) {
$ERROR("PluralRules object created with constructor as function was not ignored as this-value.");
}
return true;
});

View File

@ -0,0 +1,27 @@
// Copyright 2016 Mozilla Corporation. All rights reserved.
// This code is governed by the license found in the LICENSE file.
/*---
esid: sec-Intl.PluralRules
description: Tests that PluralRules throws when called as a function
author: Zibi Braniecki
includes: [testIntl.js]
---*/
assert.throws(TypeError, function() {
Intl.PluralRules();
}, "Intl.PluralRules throws when called as a function");
assert.throws(TypeError, function() {
Intl.PluralRules.call(undefined);
}, "Intl.PluralRules throws when called as a function with |undefined| as this-value");
testWithIntlConstructors(function (Constructor) {
var obj = new Constructor();
assert.throws(TypeError, function() {
Intl.PluralRules.call(obj)
}, "Intl.PluralRules throws when called as a function with an Intl-object as this-value");
return true;
});

View File

@ -5,7 +5,7 @@
description: Abrupt completion returned by evaluation of initializer (async generator named function expression)
esid: sec-asyncgenerator-definitions-evaluation
features: [default-parameters, async-iteration]
flags: [generated, async]
flags: [generated]
info: |
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
( FormalParameters ) { AsyncGeneratorBody }

View File

@ -5,7 +5,7 @@
description: Referencing a parameter that occurs later in the ParameterList (async generator named function expression)
esid: sec-asyncgenerator-definitions-evaluation
features: [default-parameters, async-iteration]
flags: [generated, async]
flags: [generated]
info: |
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
( FormalParameters ) { AsyncGeneratorBody }

View File

@ -5,7 +5,7 @@
description: Referencing a parameter from within its own initializer (async generator named function expression)
esid: sec-asyncgenerator-definitions-evaluation
features: [default-parameters, async-iteration]
flags: [generated, async]
flags: [generated]
info: |
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
( FormalParameters ) { AsyncGeneratorBody }

View File

@ -6,9 +6,11 @@ description: >
[[Delete]] behavior for a key that does not describe an exported binding
info: |
[...]
2. Let exports be the value of O's [[Exports]] internal slot.
3. If P is an element of exports, return false.
4. Return true.
2. If Type(P) is Symbol, then
a. Return ? OrdinaryDelete(O, P).
3. Let exports be O.[[Exports]].
4. If P is an element of exports, return false.
5. Return true.
flags: [module]
features: [Reflect, Symbol, Symbol.toStringTag]
---*/
@ -24,9 +26,9 @@ assert(
Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
);
assert(delete ns[Symbol.toStringTag], 'delete: Symbol.toStringTag');
assert(
Reflect.deleteProperty(ns, Symbol.toStringTag),
assert.throws(TypeError, function() { delete ns[Symbol.toStringTag]; }, 'delete: Symbol.toStringTag');
assert.sameValue(
Reflect.deleteProperty(ns, Symbol.toStringTag), false,
'Reflect.deleteProperty: Symbol.toStringTag'
);