mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
523a30a016
Embrace the defaults! --------- Co-authored-by: Yuji Sugiura <y.sugiura.0316@gmail.com>
12 lines
323 B
JavaScript
12 lines
323 B
JavaScript
// Unique token which is not exposed publicly.
|
|
// Used to prevent user calling class constructors.
|
|
export const TOKEN = {};
|
|
|
|
/**
|
|
* Throw error when restricted class constructor is called by user code.
|
|
* @throws {Error}
|
|
*/
|
|
export function constructorError() {
|
|
throw new Error("Constructor is for internal use only");
|
|
}
|