lib: prefer symbol to number in webidl type function

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Antoine du Hamel 2024-11-07 23:21:50 +00:00 committed by GitHub
parent c8e12983ad
commit 979526fd99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@ const {
ObjectPrototypeIsPrototypeOf, ObjectPrototypeIsPrototypeOf,
SafeSet, SafeSet,
String, String,
Symbol,
SymbolIterator, SymbolIterator,
TypeError, TypeError,
} = primordials; } = primordials;
@ -30,14 +31,14 @@ const { kEmptyObject } = require('internal/util');
const converters = { __proto__: null }; const converters = { __proto__: null };
const UNDEFINED = 1; const UNDEFINED = Symbol('undefined');
const BOOLEAN = 2; const BOOLEAN = Symbol('boolean');
const STRING = 3; const STRING = Symbol('string');
const SYMBOL = 4; const SYMBOL = Symbol('symbol');
const NUMBER = 5; const NUMBER = Symbol('number');
const BIGINT = 6; const BIGINT = Symbol('bigint');
const NULL = 7; const NULL = Symbol('null');
const OBJECT = 8; const OBJECT = Symbol('object');
/** /**
* @see https://webidl.spec.whatwg.org/#es-any * @see https://webidl.spec.whatwg.org/#es-any