@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
22 lines • 909 B
JavaScript
;
/**
* Ensures the global `Symbol.metadata` well-known symbol exists.
*
* The serialization decorator store keys its metadata off `Symbol.metadata`. On a runtime that
* supports `Symbol` but does not yet expose `Symbol.metadata` natively, the symbol must be created
* so decorated classes can attach their serialization metadata to their constructor.
*
* This module installs the symbol as a one-time, idempotent side effect. Import it for its side
* effect at package entry points before any decorated class is evaluated.
*/
function ApplySymbolMetadataPolyfill() {
if (typeof Symbol !== "undefined" && !Symbol.metadata) {
Object.defineProperty(Symbol, "metadata", {
configurable: true,
writable: true,
value: Symbol("Symbol.metadata"),
});
}
}
ApplySymbolMetadataPolyfill();
//# sourceMappingURL=symbolMetadataPolyfill.js.map