Skip to content

Commit a1a64b2

Browse files
committed
fixup! lib: refactor internal webidl converters
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
1 parent 3618c25 commit a1a64b2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/internal/webidl.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ function createSequenceConverter(converter) {
646646
// Web IDL sequence conversion step 1: require an ECMA-262 Object.
647647
if (type(V) !== 'Object') {
648648
throw makeException(
649-
'can not be converted to sequence.',
649+
'cannot be converted to sequence.',
650650
options);
651651
}
652652

@@ -655,13 +655,13 @@ function createSequenceConverter(converter) {
655655
// Step 3: throw if the iterator method is undefined or null.
656656
if (method === undefined || method === null) {
657657
throw makeException(
658-
'can not be converted to sequence.',
658+
'cannot be converted to sequence.',
659659
options);
660660
}
661661
// GetMethod also throws if the method is not callable.
662662
if (typeof method !== 'function') {
663663
throw makeException(
664-
'can not be converted to sequence.',
664+
'cannot be converted to sequence.',
665665
options);
666666
}
667667

@@ -670,7 +670,7 @@ function createSequenceConverter(converter) {
670670
const nextMethod = iterator?.next;
671671
if (typeof nextMethod !== 'function') {
672672
throw makeException(
673-
'can not be converted to sequence.',
673+
'cannot be converted to sequence.',
674674
options);
675675
}
676676

@@ -681,7 +681,7 @@ function createSequenceConverter(converter) {
681681
const next = FunctionPrototypeCall(nextMethod, iterator);
682682
if (type(next) !== 'Object') {
683683
throw makeException(
684-
'can not be converted to sequence.',
684+
'cannot be converted to sequence.',
685685
options);
686686
}
687687
// Step 3.2: return the sequence when the iterator is done.

test/parallel/test-internal-webidl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ assert.throws(() => webidl.requiredArguments(1, 2, opts), {
374374
assert.throws(() => converter({ [Symbol.iterator]: 1 }, opts), {
375375
name: 'TypeError',
376376
code: 'ERR_INVALID_ARG_TYPE',
377-
message: 'Prefix: Context can not be converted to sequence.',
377+
message: 'Prefix: Context cannot be converted to sequence.',
378378
});
379379
}
380380

0 commit comments

Comments
 (0)