mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 15:04:43 +02:00
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:
parent
ef7b99970b
commit
3291704eb2
@ -14,16 +14,15 @@ YieldExpression: yield * AssignmentExpression
|
|||||||
5. Let received be NormalCompletion(undefined).
|
5. Let received be NormalCompletion(undefined).
|
||||||
6. Repeat
|
6. Repeat
|
||||||
a. If received.[[Type]] is normal, then
|
a. If received.[[Type]] is normal, then
|
||||||
i. Let innerResult be ? IteratorNext(iterator, received.[[Value]]).
|
i. Let innerResult be ? Invoke(iterator, "next", « received.[[Value]] »).
|
||||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
ii. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||||
« received.[[Value]] »).
|
|
||||||
iii. If generatorKind is async, then set innerResult to
|
|
||||||
? Await(innerResult).
|
|
||||||
...
|
...
|
||||||
v. Let done be ? IteratorComplete(innerResult).
|
iv. Let done be ? IteratorComplete(innerResult).
|
||||||
vi. If done is true, then
|
v. If done is true, then
|
||||||
1. Return ? IteratorValue(innerResult).
|
1. Let resultValue be ? IteratorValue(innerResult).
|
||||||
vii. Let received be GeneratorYield(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 ] )
|
GetIterator ( obj [ , hint ] )
|
||||||
@ -37,13 +36,10 @@ YieldExpression: yield * AssignmentExpression
|
|||||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||||
...
|
...
|
||||||
|
|
||||||
GeneratorYield ( iterNextObj )
|
AsyncGeneratorYield ( value )
|
||||||
|
|
||||||
...
|
...
|
||||||
10. If generatorKind is async,
|
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||||
a. Let value be IteratorValue(iterNextObj).
|
|
||||||
b. Let done be IteratorComplete(iterNextObj).
|
|
||||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
|
||||||
...
|
...
|
||||||
|
|
||||||
flags: [async]
|
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].name, "get next value (1)");
|
||||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
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.value, "next-value-1");
|
||||||
assert.sameValue(v.done, false);
|
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 => {
|
iter.next("next-arg-2").then(v => {
|
||||||
assert.sameValue(log[10].name, "get next");
|
assert.sameValue(log[9].name, "get next");
|
||||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||||
|
|
||||||
assert.sameValue(log[11].name, "call next");
|
assert.sameValue(log[10].name, "call next");
|
||||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||||
|
|
||||||
assert.sameValue(log[12].name, "get next then (2)");
|
assert.sameValue(log[11].name, "get next then (2)");
|
||||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
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[12].name, "call next then (2)");
|
||||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||||
|
|
||||||
assert.sameValue(log[14].name, "get next done (2)");
|
assert.sameValue(log[13].name, "get next done (2)");
|
||||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
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[14].name, "get next value (2)");
|
||||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||||
|
|
||||||
assert.sameValue(log[16].name, "after yield*");
|
assert.sameValue(log[15].name, "after yield*");
|
||||||
assert.sameValue(log[16].value, "next-value-2");
|
assert.sameValue(log[15].value, "next-value-2");
|
||||||
|
|
||||||
assert.sameValue(v.value, "return-value");
|
assert.sameValue(v.value, "return-value");
|
||||||
assert.sameValue(v.done, true);
|
assert.sameValue(v.done, true);
|
||||||
|
|
||||||
assert.sameValue(log.length, 17, "log.length");
|
assert.sameValue(log.length, 16, "log.length");
|
||||||
}).then($DONE, $DONE);
|
}).then($DONE, $DONE);
|
||||||
}).catch($DONE);
|
}).catch($DONE);
|
||||||
|
@ -14,27 +14,21 @@ info: |
|
|||||||
i. Assert: received.[[Type]] is return.
|
i. Assert: received.[[Type]] is return.
|
||||||
ii. Let return be ? GetMethod(iterator, "return").
|
ii. Let return be ? GetMethod(iterator, "return").
|
||||||
iii. If return is undefined, return Completion(received).
|
iii. If return is undefined, return Completion(received).
|
||||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||||
« received.[[Value]] »).
|
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||||
v. If generatorKind is async, then set innerReturnResult to
|
|
||||||
? Await(innerReturnResult).
|
|
||||||
...
|
...
|
||||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||||
viii. If done is true, then
|
viii. If done is true, then
|
||||||
1. Let value be ? IteratorValue(innerReturnResult).
|
1. Let value be ? IteratorValue(innerReturnResult).
|
||||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
2. If generatorKind is async, then set value to ? Await(value).
|
||||||
[[Target]]: empty}.
|
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||||
ix. Let received be GeneratorYield(innerResult).
|
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||||
|
...
|
||||||
GeneratorYield ( iterNextObj )
|
|
||||||
|
|
||||||
|
AsyncGeneratorYield ( value )
|
||||||
...
|
...
|
||||||
10. If generatorKind is async,
|
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||||
a. Let value be IteratorValue(iterNextObj).
|
|
||||||
b. Let done be IteratorComplete(iterNextObj).
|
|
||||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
|
||||||
...
|
...
|
||||||
|
|
||||||
flags: [async]
|
flags: [async]
|
||||||
features: [async-iteration, Symbol.asyncIterator]
|
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].name, "get return value (1)");
|
||||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
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.value, "return-value-1");
|
||||||
assert.sameValue(v.done, false);
|
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 => {
|
iter.return("return-arg-2").then(v => {
|
||||||
assert.sameValue(log[9].name, "get return");
|
assert.sameValue(log[8].name, "get return");
|
||||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||||
|
|
||||||
assert.sameValue(log[10].name, "call return");
|
assert.sameValue(log[9].name, "call return");
|
||||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||||
|
|
||||||
assert.sameValue(log[11].name, "get return then (2)");
|
assert.sameValue(log[10].name, "get return then (2)");
|
||||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
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[11].name, "call return then (2)");
|
||||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||||
|
|
||||||
assert.sameValue(log[13].name, "get return done (2)");
|
assert.sameValue(log[12].name, "get return done (2)");
|
||||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
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[13].name, "get return value (2)");
|
||||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||||
|
|
||||||
assert.sameValue(v.value, "return-value-2");
|
assert.sameValue(v.value, "return-value-2");
|
||||||
assert.sameValue(v.done, true);
|
assert.sameValue(v.done, true);
|
||||||
|
|
||||||
assert.sameValue(log.length, 15, "log.length");
|
assert.sameValue(log.length, 14, "log.length");
|
||||||
}).then($DONE, $DONE);
|
}).then($DONE, $DONE);
|
||||||
}).catch($DONE);
|
}).catch($DONE);
|
||||||
}).catch($DONE);
|
}).catch($DONE);
|
||||||
|
@ -14,22 +14,20 @@ info: |
|
|||||||
i. Let throw be ? GetMethod(iterator, "throw").
|
i. Let throw be ? GetMethod(iterator, "throw").
|
||||||
ii. If throw is not undefined, then
|
ii. If throw is not undefined, then
|
||||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||||
2. If generatorKind is async, then set innerResult to
|
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||||
? Await(innerResult).
|
|
||||||
...
|
...
|
||||||
5. Let done be ? IteratorComplete(innerResult).
|
5. Let done be ? IteratorComplete(innerResult).
|
||||||
6. If done is true, then
|
6. If done is true, then
|
||||||
a. Return ? IteratorValue(innerResult).
|
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||||
7. Let received be GeneratorYield(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,
|
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||||
a. Let value be IteratorValue(iterNextObj).
|
|
||||||
b. Let done be IteratorComplete(iterNextObj).
|
|
||||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
|
||||||
...
|
...
|
||||||
|
|
||||||
flags: [async]
|
flags: [async]
|
||||||
@ -188,45 +186,42 @@ iter.next().then(v => {
|
|||||||
assert.sameValue(log[7].name, "get throw value (1)");
|
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[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.value, "throw-value-1");
|
||||||
assert.sameValue(v.done, false);
|
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 => {
|
iter.throw("throw-arg-2").then(v => {
|
||||||
assert.sameValue(log[9].name, "get throw");
|
assert.sameValue(log[8].name, "get throw");
|
||||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||||
|
|
||||||
assert.sameValue(log[10].name, "call throw");
|
assert.sameValue(log[9].name, "call throw");
|
||||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||||
|
|
||||||
assert.sameValue(log[11].name, "get throw then (2)");
|
assert.sameValue(log[10].name, "get throw then (2)");
|
||||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||||
|
|
||||||
assert.sameValue(log[12].name, "call throw then (2)");
|
assert.sameValue(log[11].name, "call throw then (2)");
|
||||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||||
|
|
||||||
assert.sameValue(log[13].name, "get throw done (2)");
|
assert.sameValue(log[12].name, "get throw done (2)");
|
||||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
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[13].name, "get throw value (2)");
|
||||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||||
|
|
||||||
assert.sameValue(log[15].name, "after yield*");
|
assert.sameValue(log[14].name, "after yield*");
|
||||||
assert.sameValue(log[15].value, "throw-value-2");
|
assert.sameValue(log[14].value, "throw-value-2");
|
||||||
|
|
||||||
assert.sameValue(v.value, "return-value");
|
assert.sameValue(v.value, "return-value");
|
||||||
assert.sameValue(v.done, true);
|
assert.sameValue(v.done, true);
|
||||||
|
|
||||||
assert.sameValue(log.length, 16, "log.length");
|
assert.sameValue(log.length, 15, "log.length");
|
||||||
}).then($DONE, $DONE);
|
}).then($DONE, $DONE);
|
||||||
}).catch($DONE);
|
}).catch($DONE);
|
||||||
}).catch($DONE);
|
}).catch($DONE);
|
||||||
|
@ -13,7 +13,6 @@ info: |
|
|||||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||||
AsyncGeneratorBody, funcEnv, strict).
|
AsyncGeneratorBody, funcEnv, strict).
|
||||||
[...]
|
[...]
|
||||||
flags: [async]
|
|
||||||
features: [async-iteration]
|
features: [async-iteration]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ description: Intl.DateTimeFormat.prototype.formatToParts.length.
|
|||||||
includes: [propertyHelper.js]
|
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");
|
verifyNotEnumerable(Intl.DateTimeFormat.prototype.formatToParts, "length");
|
||||||
verifyNotWritable(Intl.DateTimeFormat.prototype.formatToParts, "length");
|
verifyNotWritable(Intl.DateTimeFormat.prototype.formatToParts, "length");
|
||||||
|
@ -9,28 +9,23 @@ description: >
|
|||||||
author: Norbert Lindenberg
|
author: Norbert Lindenberg
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var read = 0;
|
var minimumSignificantDigitsRead = false;
|
||||||
|
var maximumSignificantDigitsRead = false;
|
||||||
|
|
||||||
function readMinimumSignificantDigits() {
|
function readMinimumSignificantDigits() {
|
||||||
++read;
|
assert.sameValue(minimumSignificantDigitsRead, false,
|
||||||
if (read === 1) {
|
"minimumSignificantDigits getter already called");
|
||||||
return 0; // invalid value, but on first read that's OK
|
assert.sameValue(maximumSignificantDigitsRead, false,
|
||||||
} else if (read === 3) {
|
"maximumSignificantDigits getter called before minimumSignificantDigits");
|
||||||
return 1; // valid value
|
minimumSignificantDigitsRead = true;
|
||||||
} else {
|
return 1;
|
||||||
$ERROR("minimumSignificantDigits read out of sequence: " + read + ".");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function readMaximumSignificantDigits() {
|
function readMaximumSignificantDigits() {
|
||||||
++read;
|
assert.sameValue(maximumSignificantDigitsRead, false,
|
||||||
if (read === 2) {
|
"maximumSignificantDigits getter already called");
|
||||||
return 0; // invalid value, but on first read that's OK
|
maximumSignificantDigitsRead = true;
|
||||||
} else if (read === 4) {
|
return 1;
|
||||||
return 1; // valid value
|
|
||||||
} else {
|
|
||||||
$ERROR("maximumSignificantDigits read out of sequence: " + read + ".");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = {};
|
var options = {};
|
||||||
@ -41,6 +36,5 @@ Object.defineProperty(options, "maximumSignificantDigits",
|
|||||||
|
|
||||||
new Intl.NumberFormat("de", options);
|
new Intl.NumberFormat("de", options);
|
||||||
|
|
||||||
if (read !== 4) {
|
assert(minimumSignificantDigitsRead, "minimumSignificantDigits getter was called once");
|
||||||
$ERROR("insuffient number of property reads: " + read + ".");
|
assert(maximumSignificantDigitsRead, "maximumSignificantDigits getter was called once");
|
||||||
}
|
|
||||||
|
@ -17,5 +17,5 @@ assert.throws(RangeError, () => new Intl.NumberFormat('en', {
|
|||||||
assert.throws(RangeError, () => new Intl.NumberFormat('en', {
|
assert.throws(RangeError, () => new Intl.NumberFormat('en', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: 'CLF',
|
currency: 'CLF',
|
||||||
maximumFractionDigits: 4
|
maximumFractionDigits: 3
|
||||||
}), 'CurrencyDigits(CLF) == 4');
|
}), 'CurrencyDigits(CLF) == 3');
|
||||||
|
11
test/intl402/PluralRules/prototype/prototype.js
vendored
11
test/intl402/PluralRules/prototype/prototype.js
vendored
@ -4,14 +4,13 @@
|
|||||||
/*---
|
/*---
|
||||||
esid: sec-properties-of-intl-pluralrules-prototype-object
|
esid: sec-properties-of-intl-pluralrules-prototype-object
|
||||||
description: >
|
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.
|
initialized as an Intl.PluralRules.
|
||||||
author: Zibi Braniecki
|
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
|
// initialized as an Intl.PluralRules
|
||||||
if (typeof Intl.PluralRules.prototype.select(0) !== "string") {
|
assert.throws(TypeError, function() {
|
||||||
$ERROR("Intl.PluralRules's prototype is not an object that has been " +
|
Intl.PluralRules.prototype.select(0);
|
||||||
"initialized as an Intl.PluralRules");
|
}, "Intl.PluralRules.prototype is not an object that has been initialized as an Intl.PluralRules");
|
||||||
}
|
|
||||||
|
@ -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;
|
|
||||||
});
|
|
27
test/intl402/PluralRules/undefined-newtarget-throws.js
Normal file
27
test/intl402/PluralRules/undefined-newtarget-throws.js
Normal 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;
|
||||||
|
});
|
@ -5,7 +5,7 @@
|
|||||||
description: Abrupt completion returned by evaluation of initializer (async generator named function expression)
|
description: Abrupt completion returned by evaluation of initializer (async generator named function expression)
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
features: [default-parameters, async-iteration]
|
features: [default-parameters, async-iteration]
|
||||||
flags: [generated, async]
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||||
( FormalParameters ) { AsyncGeneratorBody }
|
( FormalParameters ) { AsyncGeneratorBody }
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
description: Referencing a parameter that occurs later in the ParameterList (async generator named function expression)
|
description: Referencing a parameter that occurs later in the ParameterList (async generator named function expression)
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
features: [default-parameters, async-iteration]
|
features: [default-parameters, async-iteration]
|
||||||
flags: [generated, async]
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||||
( FormalParameters ) { AsyncGeneratorBody }
|
( FormalParameters ) { AsyncGeneratorBody }
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
description: Referencing a parameter from within its own initializer (async generator named function expression)
|
description: Referencing a parameter from within its own initializer (async generator named function expression)
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
features: [default-parameters, async-iteration]
|
features: [default-parameters, async-iteration]
|
||||||
flags: [generated, async]
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||||
( FormalParameters ) { AsyncGeneratorBody }
|
( FormalParameters ) { AsyncGeneratorBody }
|
||||||
|
@ -6,9 +6,11 @@ description: >
|
|||||||
[[Delete]] behavior for a key that does not describe an exported binding
|
[[Delete]] behavior for a key that does not describe an exported binding
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let exports be the value of O's [[Exports]] internal slot.
|
2. If Type(P) is Symbol, then
|
||||||
3. If P is an element of exports, return false.
|
a. Return ? OrdinaryDelete(O, P).
|
||||||
4. Return true.
|
3. Let exports be O.[[Exports]].
|
||||||
|
4. If P is an element of exports, return false.
|
||||||
|
5. Return true.
|
||||||
flags: [module]
|
flags: [module]
|
||||||
features: [Reflect, Symbol, Symbol.toStringTag]
|
features: [Reflect, Symbol, Symbol.toStringTag]
|
||||||
---*/
|
---*/
|
||||||
@ -24,9 +26,9 @@ assert(
|
|||||||
Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
|
Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(delete ns[Symbol.toStringTag], 'delete: Symbol.toStringTag');
|
assert.throws(TypeError, function() { delete ns[Symbol.toStringTag]; }, 'delete: Symbol.toStringTag');
|
||||||
assert(
|
assert.sameValue(
|
||||||
Reflect.deleteProperty(ns, Symbol.toStringTag),
|
Reflect.deleteProperty(ns, Symbol.toStringTag), false,
|
||||||
'Reflect.deleteProperty: Symbol.toStringTag'
|
'Reflect.deleteProperty: Symbol.toStringTag'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user