Skip to content

Commit 1568733

Browse files
committedNov 16, 2024
lib: prefer symbol to number in webidl type function
PR-URL: #55737 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com>
1 parent e1b42e7 commit 1568733

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
 

‎lib/internal/webidl.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616
ObjectPrototypeIsPrototypeOf,
1717
SafeSet,
1818
String,
19+
Symbol,
1920
SymbolIterator,
2021
TypeError,
2122
} = primordials;
@@ -30,14 +31,14 @@ const { kEmptyObject } = require('internal/util');
3031

3132
const converters = { __proto__: null };
3233

33-
const UNDEFINED = 1;
34-
const BOOLEAN = 2;
35-
const STRING = 3;
36-
const SYMBOL = 4;
37-
const NUMBER = 5;
38-
const BIGINT = 6;
39-
const NULL = 7;
40-
const OBJECT = 8;
34+
const UNDEFINED = Symbol('undefined');
35+
const BOOLEAN = Symbol('boolean');
36+
const STRING = Symbol('string');
37+
const SYMBOL = Symbol('symbol');
38+
const NUMBER = Symbol('number');
39+
const BIGINT = Symbol('bigint');
40+
const NULL = Symbol('null');
41+
const OBJECT = Symbol('object');
4142

4243
/**
4344
* @see https://webidl.spec.whatwg.org/#es-any

0 commit comments

Comments
 (0)