]>
Lady’s Gitweb - Pisces/blob - symbol.js
1 // ♓🌟 Piscēs ∷ symbol.js
2 // ====================================================================
4 // Copyright © 2023 Lady [@ Lady’s Computer].
6 // This Source Code Form is subject to the terms of the Mozilla Public
7 // License, v. 2.0. If a copy of the MPL was not distributed with this
8 // file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
10 import { createCallableFunction
} from "./function.js";
13 * Returns the description for the provided symbol.
15 * ※ This is effectively an alias for the `Symbol::description`
18 * ☡ This function throws if the provided argument is not a symbol.
20 export const getSymbolDescription
= createCallableFunction(
21 Object
.getOwnPropertyDescriptor(Symbol
.prototype, "description").get,
22 { name
: "getSymbolDescription" },
26 * Returns a string representation of the provided symbol.
28 * ※ Use `getSymbolDescription` instead if you just want the text
29 * description of a symbol.
31 * ※ This is effectively an alias for the `Symbol::toString`.
33 * ☡ This function throws if the provided argument is not a symbol.
35 export const symbolToString
= createCallableFunction(
36 Symbol
.prototype.toString
,
37 { name
: "symbolToString" },
41 * Returns the value of the provided symbol.
43 * ※ This is effectively an alias for the `Symbol::valueOf`.
45 * ☡ This function throws if the provided argument is not a symbol and
46 * does not have a `[[SymbolData]]` slot.
48 export const symbolValue
= createCallableFunction(
49 Symbol
.prototype.valueOf
,
50 { name
: "symbolValue" },
This page took 0.050638 seconds and 5 git commands to generate.