file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Static properties:
Also inherits static properties from its parent `TypedArray`.
- `BigInt64Array.BYTES_PER_ELEMENT`: Returns a number value of the element size. `8` in the case of `BigInt64Array`. | [
-0.5507924556732178,
0.12370678037405014,
-1.0059723854064941,
0.017127633094787598,
-0.11009018123149872,
-1.386156439781189,
0.2576448619365692,
0.7378453016281128,
-0.17000892758369446,
-0.11478780210018158,
-0.46113333106040955,
0.5858598351478577,
-0.5301446914672852,
0.00852779950946... |
javascript/reference/global_objects/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Static methods:
Inherits static methods from its parent `TypedArray`. | [
-0.2819136083126068,
0.16756588220596313,
-1.1088215112686157,
-0.035256389528512955,
0.06107700988650322,
-1.0737123489379883,
0.36118975281715393,
1.4735959768295288,
-0.3291013240814209,
-0.14053528010845184,
-0.6420349478721619,
-0.5158432722091675,
-0.40281739830970764,
0.189654946327... |
javascript/reference/global_objects/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Instance properties:
Also inherits instance properties from its parent `TypedArray`.
These properties are defined on `BigInt64Array.prototype` and shared by all `BigInt64Array` instances.
- `BigInt64Array.prototype.BYTES_PER_ELEMENT`: Returns a number value of the elemen... | [
0.39344504475593567,
0.26972338557243347,
-0.1352793425321579,
0.47424039244651794,
0.600779116153717,
0.17850781977176666,
-0.008208831772208214,
0.9188785552978516,
0.19972799718379974,
-0.3883639872074127,
-0.7614346742630005,
0.1814669966697693,
0.19785191118717194,
0.16646835207939148... |
javascript/reference/global_objects/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Instance methods:
Inherits instance methods from its parent `TypedArray`. | [
0.2775561213493347,
0.0001864747318904847,
-0.8214707374572754,
0.21194688975811005,
-0.25987690687179565,
-0.9064854979515076,
0.3291627764701843,
0.8055744767189026,
-0.25415489077568054,
-0.491976261138916,
-0.4902377724647522,
-0.22616428136825562,
-0.3207663297653198,
0.52263629436492... |
javascript/reference/global_objects/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Examples - Different ways to create a BigInt64Array:
Example:
// From a length
const bigint64 = new BigInt64Array(2);
bigint64[0] = 42n;
console.log(bigint64[0]); // 42n
console.log(bigint64.length); // 2
console.log(bigint64.BYTES_PER_ELEMENT); // 8
// From an array
con... | [
-0.21912901103496552,
-0.3004510998725891,
-0.2955283224582672,
0.6502189040184021,
0.5413075685501099,
0.11371580511331558,
0.12095092982053757,
0.6809782981872559,
-0.018817467615008354,
0.03513268008828163,
0.30661049485206604,
0.04855488985776901,
0.1289595365524292,
-0.056058231741189... |
javascript/reference/global_objects/bigint64array/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array:
The `BigInt64Array()` constructor creates `BigInt64Array` objects. The contents are initialized to `0n` unless initialization data is explicitly provided. | [
0.07365681976079941,
0.1222577914595604,
-0.6326760649681091,
0.8058685064315796,
-0.02839759550988674,
-0.8053724765777588,
-0.7514491677284241,
0.456179678440094,
-0.19260121881961823,
0.26450294256210327,
-0.20496730506420135,
-0.5482490658760071,
-0.3907180428504944,
-0.301064699888229... |
javascript/reference/global_objects/bigint64array/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Syntax:
Example:
new BigInt64Array()
new BigInt64Array(length)
new BigInt64Array(typedArray)
new BigInt64Array(object)
new BigInt64Array(buffer)
new BigInt64Array(buffer, byteOffset)
new BigInt64Array(buffer, byteOffset, length)
Note: `BigInt64Array()` can only be const... | [
-0.18413901329040527,
0.2980921268463135,
-0.712735652923584,
0.5416641235351562,
0.7879331707954407,
-0.8528975248336792,
0.35054346919059753,
1.1131565570831299,
-0.10387032479047775,
0.38845396041870117,
-0.45161300897598267,
0.1100681871175766,
0.7807251214981079,
0.09035436064004898,
... |
javascript/reference/global_objects/bigint64array/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Syntax - Parameters:
See `TypedArray`. | [
0.47740304470062256,
0.11013554036617279,
-0.9431515336036682,
0.08772387355566025,
-0.16971620917320251,
-0.6856671571731567,
-0.11391086876392365,
0.7313905358314514,
0.19579662382602692,
0.15028896927833557,
-0.1830088347196579,
-0.1369531899690628,
0.42312753200531006,
0.56064808368682... |
javascript/reference/global_objects/bigint64array/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Syntax - Exceptions:
See `TypedArray`. | [
0.10710059106349945,
-0.2339421808719635,
-0.6708740592002869,
0.3131011724472046,
-0.24926351010799408,
-1.0939157009124756,
-0.5055076479911804,
0.8021755814552307,
0.019238395616412163,
-0.0863359272480011,
0.07326985895633698,
-0.40847283601760864,
0.06733261793851852,
0.55907273292541... |
javascript/reference/global_objects/bigint64array/bigint64array/index.md | JavaScript - Global Objects - BigInt64Array - Examples - Different ways to create a BigInt64Array:
Example:
// From a length
const bigint64 = new BigInt64Array(2);
bigint64[0] = 42n;
console.log(bigint64[0]); // 42n
console.log(bigint64.length); // 2
console.log(bigint64.BYTES_PER_ELEMENT); // 8
// From an array
con... | [
-0.21912901103496552,
-0.3004510998725891,
-0.2955283224582672,
0.6502189040184021,
0.5413075685501099,
0.11371580511331558,
0.12095092982053757,
0.6809782981872559,
-0.018817467615008354,
0.03513268008828163,
0.30661049485206604,
0.04855488985776901,
0.1289595365524292,
-0.056058231741189... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry:
A `FinalizationRegistry` object lets you request a callback when a value is garbage-collected. | [
-0.3753478229045868,
-0.14372777938842773,
-0.6278232932090759,
0.19113978743553162,
-0.7019373774528503,
-1.6226893663406372,
0.38800477981567383,
0.2006841003894806,
-0.42611461877822876,
0.4348491132259369,
-0.5557093024253845,
0.22724056243896484,
0.9053411483764648,
0.8942110538482666... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Description:
`FinalizationRegistry` provides a way to request that a cleanup callback get called at some point when a value registered with the registry has been reclaimed (garbage-collected). (Cleanup callbacks are sometimes called finalizers.)
Note: Cleanup callb... | [
0.32848984003067017,
-0.12253458052873611,
-0.4968569576740265,
0.2862543761730194,
0.521792471408844,
-1.1540358066558838,
0.07821395993232727,
1.2538846731185913,
-0.16914208233356476,
0.31772562861442566,
-0.05803688243031502,
0.7240008115768433,
0.46632957458496094,
-0.0826732665300369... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Description - Avoid where possible:
Correct use of `FinalizationRegistry` takes careful thought, and it's best avoided if possible. It's also important to avoid relying on any specific behaviors not guaranteed by the specification. When, how, and whether garbage col... | [
0.2967189848423004,
-0.425161212682724,
-0.6949844360351562,
0.849819540977478,
0.7341037392616272,
-1.070573329925537,
-0.7170788049697876,
0.776628315448761,
-0.6091424226760864,
0.33059048652648926,
0.2479822337627411,
0.1366625875234604,
0.48266616463661194,
0.17912304401397705,
0.00... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Description - Notes on cleanup callbacks:
- Developers shouldn't rely on cleanup callbacks for essential program logic. Cleanup callbacks may be useful for reducing memory usage across the course of a program, but are unlikely to be useful otherwise.
- If your code ... | [
-0.44660279154777527,
0.7063571810722351,
-1.282910943031311,
0.15346898138523102,
-0.6199944019317627,
-1.0008996725082397,
0.8377366662025452,
-0.14774924516677856,
-0.47671598196029663,
0.5955663323402405,
-0.30216288566589355,
0.37667757272720337,
0.5382368564605713,
0.768898069858551,... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Constructor:
- `FinalizationRegistry()`: Creates a new `FinalizationRegistry` object. | [
-0.5718972086906433,
-0.16608008742332458,
-0.5601012706756592,
-0.09063953906297684,
-0.8077782392501831,
-0.8404338359832764,
-0.17737482488155365,
1.0607558488845825,
-0.13593895733356476,
-0.0062070018611848354,
-0.44784221053123474,
-0.04581796005368233,
0.8033038377761841,
0.67318868... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Instance properties:
These properties are defined on `FinalizationRegistry.prototype` and shared by all `FinalizationRegistry` instances.
- `FinalizationRegistry.prototype.constructor`: The constructor function that created the instance object. For `FinalizationReg... | [
-0.18031670153141022,
-0.44745975732803345,
0.08823949098587036,
0.29480382800102234,
0.1492151916027069,
-0.778063178062439,
0.07955684512853622,
0.6683641076087952,
0.20342902839183807,
-0.3930458128452301,
-1.0488200187683105,
-0.277060329914093,
0.5165939927101135,
0.16606169939041138,... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Instance methods:
- `FinalizationRegistry.prototype.register()`: Registers an object with the registry in order to get a cleanup callback when/if the object is garbage-collected.
- `FinalizationRegistry.prototype.unregister()`: Unregisters an object from the registr... | [
-0.4621346890926361,
-0.6034044027328491,
-0.3108833432197571,
-0.05759536474943161,
-0.672932505607605,
-1.2508183717727661,
-0.028948001563549042,
0.42044156789779663,
-0.10995590686798096,
0.7085028886795044,
-0.9066267609596252,
0.6327407360076904,
1.083237648010254,
0.2148619890213012... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Examples - Creating a new registry:
You create the registry passing in the callback:
Example:
const registry = new FinalizationRegistry((heldValue) => {
// …
}); | [
-0.011072097346186638,
-0.1747799664735794,
-0.512196958065033,
0.8051353693008423,
-0.7011557817459106,
-0.876230776309967,
-0.4064834713935852,
0.6986551880836487,
0.09042569249868393,
0.07009804248809814,
-0.4410702884197235,
0.1362559199333191,
1.0336652994155884,
0.8706662654876709,
... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Examples - Registering objects for cleanup:
Then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a held value for it:
Example:
registry.register(theObject, "some value"); | [
-0.27175769209861755,
0.19308693706989288,
-0.5880996584892273,
0.556255042552948,
-0.9438067674636841,
-1.557774305343628,
0.08341075479984283,
0.592605710029602,
-0.17580631375312805,
0.2387356162071228,
-0.39437490701675415,
0.41614651679992676,
1.025482416152954,
0.21018537878990173,
... |
javascript/reference/global_objects/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Examples - Callbacks never called synchronously:
No matter how much pressure you put on the garbage collector, the cleanup callback will never be called synchronously. The object may be reclaimed synchronously, but the callback will always be called sometime after t... | [
-0.22858868539333344,
0.11313744634389877,
-0.7868465185165405,
0.7672213315963745,
0.41324493288993835,
-0.44027701020240784,
-0.3667794167995453,
1.2350248098373413,
-0.24535390734672546,
0.1960504800081253,
-0.11576751619577408,
0.18481537699699402,
0.27297037839889526,
0.35751205682754... |
javascript/reference/global_objects/finalizationregistry/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry:
The `FinalizationRegistry()` constructor creates `FinalizationRegistry` objects. | [
-0.2927233576774597,
-0.09255911409854889,
-0.3999040722846985,
0.1627654880285263,
-1.0057809352874756,
-0.8970329165458679,
-0.04071972146630287,
0.7201694250106812,
-0.13403253257274628,
0.10778707265853882,
-0.4682108461856842,
0.04097588732838631,
0.6351587176322937,
0.550151050090789... |
javascript/reference/global_objects/finalizationregistry/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Syntax:
Example:
new FinalizationRegistry(callbackFn)
Note: `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a `TypeError`. | [
-0.679496705532074,
0.36428117752075195,
-0.0718710720539093,
-0.14531047642230988,
-0.7996537089347839,
-0.9085139036178589,
-0.28210124373435974,
0.7888176441192627,
-0.12011236697435379,
0.229471355676651,
-0.14913256466388702,
0.6140897870063782,
0.9931336641311646,
0.7972445487976074,... |
javascript/reference/global_objects/finalizationregistry/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Syntax - Parameters:
- `callback`: A function to be invoked each time a registered target value is garbage collected. Its return value is ignored. The function is called with the following arguments:
- `heldValue`: The value that was passed to the second parameter... | [
-0.32682761549949646,
0.1364951729774475,
-1.1692272424697876,
0.09651951491832733,
-0.6621593832969666,
-1.824790358543396,
0.8041562438011169,
0.22993037104606628,
-0.8047839403152466,
0.4247713088989258,
-0.7629303932189941,
0.2269175797700882,
0.6597523093223572,
1.1332831382751465,
... |
javascript/reference/global_objects/finalizationregistry/finalizationregistry/index.md | JavaScript - Global Objects - FinalizationRegistry - Examples - Creating a new registry:
You create the registry passing in the callback:
Example:
const registry = new FinalizationRegistry((heldValue) => {
// …
}); | [
-0.011072097346186638,
-0.1747799664735794,
-0.512196958065033,
0.8051353693008423,
-0.7011557817459106,
-0.876230776309967,
-0.4064834713935852,
0.6986551880836487,
0.09042569249868393,
0.07009804248809814,
-0.4410702884197235,
0.1362559199333191,
1.0336652994155884,
0.8706662654876709,
... |
javascript/reference/global_objects/finalizationregistry/register/index.md | JavaScript - Global Objects - FinalizationRegistry - register:
The `register()` method of `FinalizationRegistry` instances registers a value with this `FinalizationRegistry` so that if the value is garbage-collected, the registry's callback may get called. | [
-0.07798619568347931,
-0.245486781001091,
-0.5607505440711975,
0.41584450006484985,
-0.7540717720985413,
-1.384366750717163,
0.24889469146728516,
0.24411773681640625,
-0.26350581645965576,
0.8072968125343323,
-0.726322591304779,
0.644378125667572,
1.049364686012268,
0.7403361797332764,
0... |
javascript/reference/global_objects/finalizationregistry/register/index.md | JavaScript - Global Objects - FinalizationRegistry - register - Syntax:
Example:
register(target, heldValue)
register(target, heldValue, unregisterToken) | [
0.26259350776672363,
-0.03529108688235283,
-0.42678314447402954,
-0.3344131410121918,
-0.9562352895736694,
-1.1772719621658325,
0.13679368793964386,
0.8544999957084656,
-0.19520261883735657,
-0.09762174636125565,
-0.4550436735153198,
0.2905742824077606,
0.7261450886726379,
0.40245807170867... |
javascript/reference/global_objects/finalizationregistry/register/index.md | JavaScript - Global Objects - FinalizationRegistry - register - Syntax - Parameters:
- `target`: The target value to register.
- `heldValue`: The value to pass to the finalizer for this `target`. This cannot be the `target` itself but can be anything else, including functions and primitives.
- `unregisterToken` (optio... | [
0.16867996752262115,
-0.1538582444190979,
-0.6448642611503601,
-0.4095822274684906,
-0.570861279964447,
-1.7048441171646118,
0.44235074520111084,
0.41859644651412964,
0.2021619975566864,
-0.15228456258773804,
-0.7055706977844238,
0.41996726393699646,
0.35762307047843933,
0.6532575488090515... |
javascript/reference/global_objects/finalizationregistry/register/index.md | JavaScript - Global Objects - FinalizationRegistry - register - Syntax - Return value:
None (`undefined`). | [
-0.3407168388366699,
0.34530314803123474,
-0.6211327910423279,
-0.8476803302764893,
-1.0356405973434448,
-0.8952948451042175,
0.4899779260158539,
1.313493013381958,
-0.43004006147384644,
0.2449227124452591,
-0.3581306040287018,
0.17092138528823853,
0.9091815948486328,
0.41859304904937744,
... |
javascript/reference/global_objects/finalizationregistry/register/index.md | JavaScript - Global Objects - FinalizationRegistry - register - Syntax - Exceptions:
- `TypeError`: Thrown in one of the following cases:
- `target` is not an object or a non-registered symbol (object as opposed to primitives; functions are objects as well)
- `target` is the same as `heldValue` (`target === heldVa... | [
0.021755415946245193,
-0.2576447129249573,
-0.6879215240478516,
-0.19677092134952545,
-0.8124094605445862,
-1.1371612548828125,
0.07142304629087448,
1.0285648107528687,
-0.09591615200042725,
-0.0470527708530426,
-0.2535979747772217,
-0.12750880420207977,
0.03802869841456413,
-0.42492616176... |
javascript/reference/global_objects/finalizationregistry/register/index.md | JavaScript - Global Objects - FinalizationRegistry - register - Description:
See the Avoid where possible and Notes on cleanup callbacks sections of the `FinalizationRegistry` page for important caveats. | [
-0.6268709301948547,
-0.06224702671170235,
-0.8119698762893677,
-0.24720048904418945,
-0.9211733937263489,
-1.5822277069091797,
-0.015531206503510475,
0.4067884087562561,
-0.27813979983329773,
0.8945955038070679,
-0.47179654240608215,
0.4871681034564972,
0.42696332931518555,
0.998857975006... |
javascript/reference/global_objects/finalizationregistry/register/index.md | JavaScript - Global Objects - FinalizationRegistry - register - Examples - Using register:
The following registers the value referenced by `target`, passing in the held value `"some value"` and passing the target itself as the unregistration token:
Example:
registry.register(target, "some value", target);
The follo... | [
0.027612805366516113,
0.09642630070447922,
-0.7286784052848816,
0.3695145547389984,
0.18204985558986664,
-0.7326937317848206,
0.5689368844032288,
0.08168569952249527,
0.03713381290435791,
0.2964983582496643,
-0.016210615634918213,
0.126609206199646,
0.3806724548339844,
0.035838138312101364... |
javascript/reference/global_objects/finalizationregistry/unregister/index.md | JavaScript - Global Objects - FinalizationRegistry - unregister:
The `unregister()` method of `FinalizationRegistry` instances unregisters a target value from this `FinalizationRegistry`. | [
-0.0865778923034668,
-0.12936857342720032,
-0.9444308280944824,
-0.5311810970306396,
-1.1900789737701416,
-1.4246954917907715,
0.6269174814224243,
0.4327617287635803,
-0.3589361011981964,
0.23519043624401093,
-0.7253341674804688,
0.010885239578783512,
0.4250662922859192,
0.4511700570583343... |
javascript/reference/global_objects/finalizationregistry/unregister/index.md | JavaScript - Global Objects - FinalizationRegistry - unregister - Syntax:
Example:
unregister(unregisterToken) | [
0.6148820519447327,
0.4943849742412567,
-0.48237475752830505,
-0.799288809299469,
-1.0244500637054443,
-1.730786919593811,
0.3527161478996277,
0.8619565367698669,
-0.46499061584472656,
-0.25421077013015747,
-0.48968836665153503,
0.4767713248729706,
0.4314468502998352,
0.45797717571258545,
... |
javascript/reference/global_objects/finalizationregistry/unregister/index.md | JavaScript - Global Objects - FinalizationRegistry - unregister - Syntax - Parameters:
- `unregisterToken`: The token used with the `register()` method when registering the target value. Multiple cells registered with the same `unregisterToken` will be unregistered together. | [
0.5347074866294861,
0.1317996233701706,
-1.1822434663772583,
-0.5625827312469482,
-0.5871855020523071,
-1.54798424243927,
0.9942113757133484,
0.8938208222389221,
-0.16398993134498596,
-0.07413657754659653,
-0.6467247009277344,
0.49000072479248047,
0.5514674186706543,
0.6047369241714478,
... |
javascript/reference/global_objects/finalizationregistry/unregister/index.md | JavaScript - Global Objects - FinalizationRegistry - unregister - Syntax - Return value:
A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. | [
0.0033981504384428263,
0.1583276242017746,
-0.755222737789154,
-0.41441816091537476,
-1.1196479797363281,
-1.312074899673462,
1.0688167810440063,
1.3316713571548462,
-0.5610865354537964,
0.15790432691574097,
-1.0514525175094604,
0.14034314453601837,
0.7145299315452576,
0.6770910024642944,
... |
javascript/reference/global_objects/finalizationregistry/unregister/index.md | JavaScript - Global Objects - FinalizationRegistry - unregister - Syntax - Exceptions:
- `TypeError`: Thrown if `unregisterToken` is not an object or a non-registered symbol. | [
0.09649895131587982,
0.17480938136577606,
-0.44629237055778503,
-0.02368835359811783,
-0.8019768595695496,
-1.6594809293746948,
0.13394537568092346,
1.2019108533859253,
-0.4402812719345093,
-0.17848044633865356,
-0.5129402875900269,
-0.07329585403203964,
0.37271708250045776,
-0.10494617372... |
javascript/reference/global_objects/finalizationregistry/unregister/index.md | JavaScript - Global Objects - FinalizationRegistry - unregister - Description:
When a target value has been reclaimed, it is no longer registered in the registry. There is no need to call `unregister` in your cleanup callback. Only call `unregister` if you haven't received a cleanup callback and no longer need to rece... | [
-0.6312434673309326,
0.311671644449234,
-1.0803723335266113,
-0.8001664280891418,
-1.1691604852676392,
-1.8144253492355347,
0.15775355696678162,
0.1365438848733902,
-0.20501725375652313,
0.49924689531326294,
0.2123701125383377,
0.08712486922740936,
0.3347266614437103,
0.7893826365470886,
... |
javascript/reference/global_objects/finalizationregistry/unregister/index.md | JavaScript - Global Objects - FinalizationRegistry - unregister - Examples - Using unregister:
This example shows registering a target object using that same object as the unregister token, then later unregistering it via `unregister`:
Example:
class Thingy {
static #cleanup = (label) => {
// ^^^... | [
-0.13562949001789093,
-0.03445179760456085,
-0.7473229169845581,
0.4184010624885559,
0.4967646300792694,
-0.7672123312950134,
-0.17015440762043,
0.5503257513046265,
-0.3385887145996094,
0.216751828789711,
0.07761351019144058,
0.4523737132549286,
-0.10788115113973618,
0.36364468932151794,
... |
javascript/reference/global_objects/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack:
The `AsyncDisposableStack` object represents a stack of async disposers to run when the stack itself is disposed. Disposer functions are executed in reverse order of registration, with strong error handling guarantees. Calling its `move()` method will transfer respon... | [
-0.3803327679634094,
-0.5797660946846008,
-1.4308500289916992,
1.1346995830535889,
-0.04122836887836456,
-1.1944677829742432,
0.13734740018844604,
0.3015355169773102,
0.40183544158935547,
1.2986172437667847,
-0.5882866978645325,
0.3994673788547516,
-0.276632696390152,
0.6444965600967407,
... |
javascript/reference/global_objects/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack - Constructor:
- `AsyncDisposableStack()`: Creates a new `AsyncDisposableStack` object. | [
-0.4660381078720093,
-0.29937049746513367,
-0.6133369207382202,
0.6093913316726685,
-0.443128377199173,
-1.6399906873703003,
0.26169952750205994,
1.0197786092758179,
0.5131214261054993,
0.7365593314170837,
-0.3476569652557373,
0.0658508837223053,
-0.4139477610588074,
0.3023969531059265,
... |
javascript/reference/global_objects/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack - Instance properties:
These properties are defined on `AsyncDisposableStack.prototype` and shared by all `AsyncDisposableStack` instances.
- `AsyncDisposableStack.prototype.constructor`: The constructor function that created the instance object. For `AsyncDisposable... | [
-0.29417502880096436,
-0.45038536190986633,
-0.4379535913467407,
0.6397271752357483,
0.23276744782924652,
-2.2833991050720215,
0.5932627320289612,
0.6919994354248047,
0.7369063496589661,
0.6344825625419617,
-0.8248205780982971,
0.3599279522895813,
-0.5094301104545593,
0.29532817006111145,
... |
javascript/reference/global_objects/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack - Instance methods:
- `AsyncDisposableStack.prototype.adopt()`: Registers a value that doesn't implement the async disposable protocol to the stack by providing a custom disposer function.
- `AsyncDisposableStack.prototype.disposeAsync()`: Disposes this stack by calli... | [
0.5507214665412903,
-0.8168003559112549,
-0.939828097820282,
0.44683974981307983,
-0.15904423594474792,
-1.7012677192687988,
0.025827012956142426,
0.0935681089758873,
0.761460542678833,
0.7278734445571899,
-1.0217801332473755,
0.6079615950584412,
-0.09415729343891144,
0.586868405342102,
... |
javascript/reference/global_objects/asyncdisposablestack/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack:
The `AsyncDisposableStack()` constructor creates `AsyncDisposableStack` objects. | [
-0.15161827206611633,
-0.12324707210063934,
-0.6678606271743774,
0.767764687538147,
-0.49421608448028564,
-1.721863031387329,
0.2045690417289734,
0.7922577857971191,
0.5459439754486084,
0.7816048860549927,
-0.40162524580955505,
0.07524920254945755,
-0.5627419352531433,
0.19304998219013214,... |
javascript/reference/global_objects/asyncdisposablestack/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack - Syntax:
Example:
new AsyncDisposableStack()
Note: `AsyncDisposableStack()` can only be constructed with `new`. Attempting to call it without `new` throws a `TypeError`. | [
-0.26654165983200073,
0.0925377905368805,
-0.5439234375953674,
0.6664867401123047,
-0.37839868664741516,
-1.582567811012268,
0.016116611659526825,
1.1427431106567383,
0.5495238900184631,
0.5336003303527832,
0.04216998443007469,
0.29525646567344666,
0.12389589101076126,
0.21300628781318665,... |
javascript/reference/global_objects/asyncdisposablestack/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack - Syntax - Parameters:
None. | [
0.24037833511829376,
0.09459637105464935,
-0.7587151527404785,
-0.22410590946674347,
-0.6587409377098083,
-1.3450833559036255,
0.9629093408584595,
1.2094018459320068,
0.49978527426719666,
0.08153655380010605,
-0.5282885432243347,
-0.06344132870435715,
-0.1038135290145874,
0.279907822608947... |
javascript/reference/global_objects/asyncdisposablestack/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack - Syntax - Return value:
A new `AsyncDisposableStack` object. | [
0.13016699254512787,
-0.263451486825943,
-0.9652406573295593,
-0.16810186207294464,
-0.5918294191360474,
-1.6863763332366943,
0.8167876601219177,
1.28485107421875,
0.6960608959197998,
0.7165113687515259,
-0.1685565859079361,
0.41451403498649597,
-0.07802292704582214,
1.0330233573913574,
... |
javascript/reference/global_objects/asyncdisposablestack/asyncdisposablestack/index.md | JavaScript - Global Objects - AsyncDisposableStack - Examples - Creating an AsyncDisposableStack:
Example:
const disposer = new AsyncDisposableStack();
disposer.defer(() => console.log("Disposed!"));
await disposer.disposeAsync();
// Logs: Disposed! | [
0.12436486780643463,
-0.25166818499565125,
-0.8959084153175354,
0.7802706360816956,
-0.3514596223831177,
-0.9129273295402527,
-0.20062409341335297,
0.4264135956764221,
0.6336776614189148,
0.6618393063545227,
-0.07114685326814651,
0.3972940444946289,
-0.46872133016586304,
0.6361510753631592... |
javascript/reference/global_objects/asyncdisposablestack/use/index.md | JavaScript - Global Objects - AsyncDisposableStack - use:
The `use()` method of `AsyncDisposableStack` instances registers a value that implements the async disposable protocol to the stack.
See `DisposableStack.prototype.use()` for general information about the `use()` method. | [
-0.03108115866780281,
-0.6542271375656128,
-1.1775795221328735,
1.146299123764038,
-0.224410280585289,
-1.9617104530334473,
1.202269434928894,
0.7164190411567688,
0.46388277411460876,
0.9101879000663757,
-0.6393399834632874,
0.6910902857780457,
0.8597934246063232,
0.29643768072128296,
1.... |
javascript/reference/global_objects/asyncdisposablestack/use/index.md | JavaScript - Global Objects - AsyncDisposableStack - use - Syntax:
Example:
use(value) | [
0.4387882649898529,
-0.02887437492609024,
-1.1261967420578003,
0.6134438514709473,
-0.8401832580566406,
-1.669657826423645,
1.1758977174758911,
0.6108145713806152,
0.5840803384780884,
0.5158597230911255,
0.0010015945881605148,
0.8697018623352051,
-0.07556916773319244,
-0.2789894640445709,
... |
javascript/reference/global_objects/asyncdisposablestack/use/index.md | JavaScript - Global Objects - AsyncDisposableStack - use - Syntax - Parameters:
- `value`: The value to register to the stack. Must either contain a `[Symbol.asyncDispose]()` or `[Symbol.dispose]()` method, or be `null` or `undefined`. | [
0.2900574803352356,
-0.501927375793457,
-0.5379016399383545,
0.6040818095207214,
-0.3815920650959015,
-1.7848519086837769,
1.3482398986816406,
0.7861393094062805,
1.0732542276382446,
0.2870132625102997,
0.011085796169936657,
0.7428393363952637,
0.5716974139213562,
0.7076207399368286,
0.7... |
javascript/reference/global_objects/asyncdisposablestack/use/index.md | JavaScript - Global Objects - AsyncDisposableStack - use - Syntax - Return value:
The same `value` that was passed in. | [
0.1577340066432953,
-0.06692517548799515,
-1.2334890365600586,
0.15208910405635834,
-0.5011847019195557,
-1.3497015237808228,
1.1132197380065918,
1.1118358373641968,
0.1158270537853241,
0.5930406451225281,
-0.308189332485199,
0.9731279611587524,
-0.017729321494698524,
1.3154445886611938,
... |
javascript/reference/global_objects/asyncdisposablestack/use/index.md | JavaScript - Global Objects - AsyncDisposableStack - use - Syntax - Exceptions:
- `TypeError`: Thrown if `value` is not `null` or `undefined`, and does not contain a `[Symbol.asyncDispose]()` or `[Symbol.dispose]()` method.
- `ReferenceError`: Thrown if the stack is already disposed. | [
-0.3170946538448334,
-0.2156611979007721,
-0.3628951907157898,
0.7781007289886475,
-0.29876387119293213,
-1.6008802652359009,
0.7406587600708008,
0.8795594573020935,
0.15925778448581696,
0.5008753538131714,
-0.14472320675849915,
0.15869203209877014,
-0.19978515803813934,
0.2424739152193069... |
javascript/reference/global_objects/asyncdisposablestack/use/index.md | JavaScript - Global Objects - AsyncDisposableStack - use - Examples - Using use():
This function reads a file (as a Node.js `FileHandle`) and returns its contents. The file handle is automatically closed when the function completes, given that the `FileHandle` class implements a `[Symbol.asyncDispose]()` method that a... | [
-0.5972983241081238,
-0.10038495063781738,
-0.7330496311187744,
0.46969667077064514,
0.3014116585254669,
-1.248323917388916,
0.7940593361854553,
-0.07089261710643768,
-0.05657486990094185,
0.5966833233833313,
-0.4788878858089447,
0.37879812717437744,
-0.8330022096633911,
0.7927914261817932... |
javascript/reference/global_objects/asyncdisposablestack/symbol.asyncdispose/index.md | JavaScript - Global Objects - AsyncDisposableStack - Symbol.asyncDispose:
The `[Symbol.asyncDispose]()` method of `AsyncDisposableStack` instances implements the async disposable protocol and allows it to be disposed when used with `await using`. It is an alias for the `disposeAsync()` method. | [
0.16693177819252014,
-0.012104606255888939,
-0.9619205594062805,
0.7365946769714355,
-0.3354053497314453,
-2.129047155380249,
0.7687519788742065,
1.2607694864273071,
0.4998666048049927,
0.8635361194610596,
-0.879491925239563,
0.3666034936904907,
0.3317837119102478,
0.7810800671577454,
1.... |
javascript/reference/global_objects/asyncdisposablestack/symbol.asyncdispose/index.md | JavaScript - Global Objects - AsyncDisposableStack - Symbol.asyncDispose - Syntax:
Example:
asyncDisposableStack[Symbol.asyncDispose]() | [
0.20638349652290344,
0.11987331509590149,
-0.7081025242805481,
-0.05219894275069237,
-0.9708451628684998,
-2.108837127685547,
0.6188319325447083,
1.1637426614761353,
0.923645555973053,
0.3543870747089386,
-0.2878327965736389,
0.6122852563858032,
-0.07722432166337967,
0.4674937129020691,
... |
javascript/reference/global_objects/asyncdisposablestack/symbol.asyncdispose/index.md | JavaScript - Global Objects - AsyncDisposableStack - Symbol.asyncDispose - Syntax - Parameters:
None. | [
0.44043174386024475,
-0.0034956892486661673,
-0.930422842502594,
-0.4403385519981384,
-0.9119283556938171,
-1.50022554397583,
0.9688553810119629,
1.4634701013565063,
0.8521116971969604,
-0.04482480138540268,
-0.7024019360542297,
0.18066535890102386,
0.24747462570667267,
0.4877241849899292,... |
javascript/reference/global_objects/asyncdisposablestack/symbol.asyncdispose/index.md | JavaScript - Global Objects - AsyncDisposableStack - Symbol.asyncDispose - Syntax - Return value:
None (`undefined`). | [
-0.11828824132680893,
0.1405744105577469,
-0.7603312730789185,
-0.5581940412521362,
-0.867976188659668,
-1.33440101146698,
0.8786841630935669,
1.2873923778533936,
0.28595930337905884,
0.3892744183540344,
-0.2746225893497467,
0.5516085624694824,
0.09932123124599457,
0.5883607268333435,
0.... |
javascript/reference/global_objects/asyncdisposablestack/symbol.asyncdispose/index.md | JavaScript - Global Objects - AsyncDisposableStack - Symbol.asyncDispose - Examples - Declaring a stack with `await using`:
The `Symbol.asyncDispose` method is intended to be automatically called in an `await using` declaration.
Example:
async function doSomething() {
await using disposer = new AsyncDisposableStac... | [
-0.15590918064117432,
0.035464584827423096,
-1.0166370868682861,
0.6298734545707703,
-0.17354080080986023,
-1.4260755777359009,
0.07850221544504166,
0.9706304669380188,
0.24303017556667328,
0.999204158782959,
-0.18439649045467377,
0.5300423502922058,
-0.0304837878793478,
0.5175178050994873... |
javascript/reference/global_objects/asyncdisposablestack/disposeasync/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposeAsync:
The `disposeAsync()` method of `AsyncDisposableStack` instances disposes this stack by calling all disposers registered to it in reverse order of registration, awaiting for each one's completion before calling the next one. If the stack is already disp... | [
-0.03518239036202431,
-0.17841339111328125,
-1.1082426309585571,
0.6621708869934082,
-0.18133629858493805,
-1.1639063358306885,
0.46958664059638977,
-0.25171080231666565,
0.09661166369915009,
1.4840909242630005,
-0.5205704569816589,
0.9221004247665405,
-0.15485580265522003,
0.8826972246170... |
javascript/reference/global_objects/asyncdisposablestack/disposeasync/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposeAsync - Syntax:
Example:
disposeAsync() | [
0.36213287711143494,
0.27546268701553345,
-0.7433465123176575,
0.21394681930541992,
-0.6856316328048706,
-1.1897521018981934,
0.3875119388103485,
1.1373220682144165,
0.6001595258712769,
0.38954752683639526,
-0.3866187036037445,
0.5523800849914551,
-0.6515004634857178,
0.7213537096977234,
... |
javascript/reference/global_objects/asyncdisposablestack/disposeasync/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposeAsync - Syntax - Parameters:
None. | [
0.46410998702049255,
0.03448024019598961,
-0.8814581632614136,
-0.16291497647762299,
-0.6299818754196167,
-0.9264203310012817,
0.9264172911643982,
1.3257532119750977,
0.6422297358512878,
0.05970803648233414,
-0.6549472212791443,
0.19309687614440918,
-0.29147136211395264,
0.607518196105957,... |
javascript/reference/global_objects/asyncdisposablestack/disposeasync/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposeAsync - Syntax - Return value:
A new `Promise` that resolves with `undefined` when all registered disposers have completed in sequence. | [
-0.33771222829818726,
-0.07168754190206528,
-0.5672995448112488,
-0.13684862852096558,
-0.665073573589325,
-0.5638716816902161,
0.7523229122161865,
0.8781263828277588,
0.04389944672584534,
0.8610680103302002,
-0.17674732208251953,
0.6897603869438171,
-0.23010165989398956,
1.447705984115600... |
javascript/reference/global_objects/asyncdisposablestack/disposeasync/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposeAsync - Syntax - Exceptions:
`disposeAsync()` never synchronously throws an error. The returned promise may reject with one of the following errors:
- `SuppressedError`: Thrown if multiple disposers in the stack threw an error. If only one error is thrown, i... | [
-0.4897335469722748,
-0.054837364703416824,
-0.5458895564079285,
0.4624847173690796,
-0.5881182551383972,
-1.3010973930358887,
0.3880400061607361,
0.8856329321861267,
-0.046549487859010696,
-0.12200897186994553,
-0.45641839504241943,
0.22484122216701508,
-0.599993109703064,
1.0786935091018... |
javascript/reference/global_objects/asyncdisposablestack/disposeasync/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposeAsync - Examples - Disposing a stack:
Here we push three disposers to the stack, using the `use()`, `adopt()`, and `defer()` methods. When `disposeAsync()` is called, the disposers are called in reverse order of registration.
Note that usually you don't need... | [
0.04428591951727867,
0.07413563877344131,
-0.5392352938652039,
0.6351882815361023,
-0.019297191873192787,
-0.0753730908036232,
0.41306763887405396,
0.6494745016098022,
0.0844716876745224,
-0.31066185235977173,
-1.0127986669540405,
0.015549028292298317,
-0.346800833940506,
0.752816021442413... |
javascript/reference/global_objects/asyncdisposablestack/disposed/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposed:
The `disposed` accessor property of `AsyncDisposableStack` instances returns a boolean indicating whether or not this `AsyncDisposableStack` has been disposed or moved by doing any of the following:
- Calling its `disposeAsync()` method
- Calling its `mov... | [
-0.7191788554191589,
-0.4094159007072449,
-0.999510645866394,
0.7711501717567444,
-0.13921472430229187,
-1.7608507871627808,
0.9569485783576965,
0.45671346783638,
0.05692048743367195,
0.9504953622817993,
-0.6596043109893799,
0.7116941213607788,
-0.6176183223724365,
1.0560418367385864,
1.... |
javascript/reference/global_objects/asyncdisposablestack/disposed/index.md | JavaScript - Global Objects - AsyncDisposableStack - disposed - Examples - Checking if a stack is disposed:
Example:
const disposer = new AsyncDisposableStack();
console.log(disposer.disposed); // false
await disposer.disposeAsync();
console.log(disposer.disposed); // true | [
-0.18372440338134766,
-0.7548696994781494,
-0.8275871872901917,
0.4359787702560425,
-0.23305176198482513,
-1.542756199836731,
0.5089734792709351,
0.581153154373169,
0.32596060633659363,
0.9151452779769897,
-0.19825035333633423,
-0.07759665697813034,
-0.23435698449611664,
0.9837324619293213... |
javascript/reference/global_objects/asyncdisposablestack/adopt/index.md | JavaScript - Global Objects - AsyncDisposableStack - adopt:
The `adopt()` method of `AsyncDisposableStack` instances registers a value that doesn't implement the async disposable protocol to the stack by providing a custom disposer function.
See `DisposableStack.prototype.adopt()` for general information about the `a... | [
0.2911355793476105,
-0.756991446018219,
-0.8365076184272766,
0.9076691269874573,
-0.2729833722114563,
-2.4108753204345703,
0.5900123119354248,
-0.08642114698886871,
-0.035562485456466675,
0.860251784324646,
-0.3241082429885864,
0.17186783254146576,
0.1737053096294403,
0.34703266620635986,
... |
javascript/reference/global_objects/asyncdisposablestack/adopt/index.md | JavaScript - Global Objects - AsyncDisposableStack - adopt - Syntax:
Example:
adopt(value, onDispose) | [
0.8217751979827881,
0.27788108587265015,
-0.678012490272522,
0.295497328042984,
-0.895626962184906,
-2.43147873878479,
0.8826596736907959,
0.27206867933273315,
0.4572875201702118,
0.46271198987960815,
0.17169387638568878,
-0.11973939836025238,
-0.31926777958869934,
0.17306970059871674,
1... |
javascript/reference/global_objects/asyncdisposablestack/adopt/index.md | JavaScript - Global Objects - AsyncDisposableStack - adopt - Syntax - Parameters:
- `value`: Any value to be registered to the stack.
- `onDispose`: A function that will be called when the stack is disposed. The function receives `value` as its only argument, and it can return a promise which gets awaited. | [
0.7920165061950684,
-0.1259491890668869,
-0.6393570303916931,
0.5426456332206726,
-0.18886598944664001,
-2.2330760955810547,
0.7454797625541687,
0.3467572033405304,
0.5537881851196289,
0.42789995670318604,
-0.07485710084438324,
0.4020138084888458,
-0.4102380573749542,
0.9755318760871887,
... |
javascript/reference/global_objects/asyncdisposablestack/adopt/index.md | JavaScript - Global Objects - AsyncDisposableStack - adopt - Syntax - Return value:
The same `value` that was passed in. | [
0.4913874566555023,
-0.1152987852692604,
-1.1759415864944458,
0.14924612641334534,
-0.6110260486602783,
-1.7555053234100342,
0.9390670657157898,
0.8248265385627747,
-0.07033299654722214,
0.6775140762329102,
-0.34559130668640137,
0.5518361926078796,
-0.31791964173316956,
1.3481329679489136,... |
javascript/reference/global_objects/asyncdisposablestack/adopt/index.md | JavaScript - Global Objects - AsyncDisposableStack - adopt - Syntax - Exceptions:
- `TypeError`: Thrown if `onDispose` is not a function.
- `ReferenceError`: Thrown if the stack is already disposed. | [
0.1445426046848297,
0.1693776547908783,
-0.47417986392974854,
0.5398666262626648,
-0.37882211804389954,
-1.8508591651916504,
0.5334160923957825,
0.5213491320610046,
-0.06754720211029053,
0.3947359323501587,
-0.22119992971420288,
-0.30751654505729675,
-0.2621629536151886,
0.3130616843700409... |
javascript/reference/global_objects/asyncdisposablestack/adopt/index.md | JavaScript - Global Objects - AsyncDisposableStack - adopt - Examples - Using adopt():
This function creates a file handle (as a Node.js `FileHandle`), that gets closed when the function completes. We suppose that the file handle does not implement the async disposable protocol (in reality it does), so we use `adopt()... | [
-0.05568407103419304,
0.06633546203374863,
-0.7617385983467102,
0.8779362440109253,
0.16034701466560364,
-1.9656652212142944,
0.32117873430252075,
-0.19740234315395355,
-0.32846736907958984,
0.8086955547332764,
-0.3355835974216461,
-0.005154814571142197,
-0.42046788334846497,
0.85585725307... |
javascript/reference/global_objects/asyncdisposablestack/defer/index.md | JavaScript - Global Objects - AsyncDisposableStack - defer:
The `defer()` method of `AsyncDisposableStack` instances takes a callback function to be called and awaited when the stack is disposed.
See `DisposableStack.prototype.defer()` for general information about the `defer()` method. | [
0.03950788825750351,
-0.17564284801483154,
-0.94820237159729,
0.7684252262115479,
-0.17811451852321625,
-1.223856806755066,
0.554338812828064,
0.45345231890678406,
-0.19721221923828125,
0.849419891834259,
-0.22664502263069153,
0.7923824787139893,
0.030887993052601814,
1.2540805339813232,
... |
javascript/reference/global_objects/asyncdisposablestack/defer/index.md | JavaScript - Global Objects - AsyncDisposableStack - defer - Syntax:
Example:
defer(onDispose) | [
0.2386825680732727,
0.6056230664253235,
-0.33612409234046936,
-0.18730713427066803,
-0.6491473913192749,
-1.510082721710205,
0.6789982318878174,
0.6761548519134521,
0.3066728115081787,
0.029686084017157555,
-0.12026863545179367,
0.8245300650596619,
-0.04642244428396225,
0.5087337493896484,... |
javascript/reference/global_objects/asyncdisposablestack/defer/index.md | JavaScript - Global Objects - AsyncDisposableStack - defer - Syntax - Parameters:
- `onDispose`: A function that will be called when the stack is disposed. The function receives no arguments and can return a promise which gets awaited. | [
0.3532811999320984,
0.23723553121089935,
-0.6600967049598694,
0.08379266411066055,
-0.01204245537519455,
-1.3414514064788818,
0.5906755328178406,
0.6334373354911804,
0.6485208868980408,
0.21437284350395203,
-0.14300398528575897,
0.4292850196361542,
-0.29063066840171814,
1.3077722787857056,... |
javascript/reference/global_objects/asyncdisposablestack/defer/index.md | JavaScript - Global Objects - AsyncDisposableStack - defer - Syntax - Return value:
None (`undefined`). | [
-0.18846850097179413,
0.23239775002002716,
-0.7469284534454346,
-0.3872954249382019,
-0.6988261938095093,
-0.9819560647010803,
0.8301948308944702,
0.7836644649505615,
0.10980506241321564,
0.35080230236053467,
-0.04043053463101387,
0.6602522730827332,
-0.035025376826524734,
0.57639259099960... |
javascript/reference/global_objects/asyncdisposablestack/defer/index.md | JavaScript - Global Objects - AsyncDisposableStack - defer - Syntax - Exceptions:
- `TypeError`: Thrown if `onDispose` is not a function.
- `ReferenceError`: Thrown if the stack is already disposed. | [
-0.10016899555921555,
0.25443005561828613,
-0.5047352910041809,
0.348682701587677,
-0.3125058710575104,
-1.3834333419799805,
0.5008045434951782,
0.7190137505531311,
0.1789221465587616,
0.12758229672908783,
-0.24848876893520355,
0.05484350398182869,
-0.06321310997009277,
0.3646215498447418,... |
javascript/reference/global_objects/asyncdisposablestack/defer/index.md | JavaScript - Global Objects - AsyncDisposableStack - defer - Examples - Using defer():
One use case of `defer()` is to do something unrelated to resource freeing during scope exit, such as logging a message.
Example:
async function doSomething() {
await using disposer = new AsyncDisposableStack();
disposer.defer... | [
-0.4437970519065857,
0.27762722969055176,
-1.197859287261963,
-0.040748968720436096,
-0.004420115612447262,
-1.098767876625061,
0.37554681301116943,
0.22498735785484314,
0.028803609311580658,
0.49227407574653625,
-0.31780996918678284,
0.7901470065116882,
-0.3316117227077484,
0.436974227428... |
javascript/reference/global_objects/asyncdisposablestack/move/index.md | JavaScript - Global Objects - AsyncDisposableStack - move:
The `move()` method of `AsyncDisposableStack` instances creates a new `AsyncDisposableStack` instance that contains the same disposers as this stack, and then marks this stack as disposed, without calling any disposers. | [
0.18214909732341766,
-0.5579550862312317,
-0.8624467849731445,
1.3119556903839111,
0.0034299634862691164,
-0.9729488492012024,
-0.17197667062282562,
0.552985668182373,
-0.08006393164396286,
0.7386114597320557,
-0.3834686279296875,
0.3308044970035553,
-0.21348880231380463,
0.702375948429107... |
javascript/reference/global_objects/asyncdisposablestack/move/index.md | JavaScript - Global Objects - AsyncDisposableStack - move - Syntax:
Example:
move() | [
0.052813366055488586,
0.18245930969715118,
-0.5253940224647522,
0.5005266070365906,
-0.6983879804611206,
-1.3742620944976807,
-0.33817219734191895,
0.8433741927146912,
0.06222851946949959,
0.14442428946495056,
-0.021228041499853134,
0.5466800332069397,
-0.6267833709716797,
0.05609375610947... |
javascript/reference/global_objects/asyncdisposablestack/move/index.md | JavaScript - Global Objects - AsyncDisposableStack - move - Syntax - Parameters:
None. | [
0.11126604676246643,
0.15109699964523315,
-0.7876307368278503,
0.32219189405441284,
-0.6746109127998352,
-0.9918360114097595,
0.2502954304218292,
1.2827351093292236,
0.2050469070672989,
0.1430121660232544,
-0.43784523010253906,
-0.09125001728534698,
-0.35601547360420227,
0.1714698821306228... |
javascript/reference/global_objects/asyncdisposablestack/move/index.md | JavaScript - Global Objects - AsyncDisposableStack - move - Syntax - Return value:
A new `AsyncDisposableStack` instance. | [
0.2803035378456116,
-0.35753563046455383,
-0.7096578478813171,
0.2822486460208893,
-0.6169013381004333,
-1.4563298225402832,
0.29418742656707764,
0.9359716773033142,
0.5340743064880371,
0.6677268147468567,
-0.18457992374897003,
0.31752249598503113,
-0.27464303374290466,
1.0293759107589722,... |
javascript/reference/global_objects/asyncdisposablestack/move/index.md | JavaScript - Global Objects - AsyncDisposableStack - move - Syntax - Exceptions:
- `ReferenceError`: Thrown if the stack is already disposed. | [
0.00681079737842083,
0.3584947884082794,
-0.4784051179885864,
0.8375950455665588,
-0.4625122547149658,
-1.6831194162368774,
0.38791486620903015,
0.6917380094528198,
-0.23991495370864868,
0.4429154396057129,
-0.276505708694458,
-0.08387045562267303,
-0.5179833769798279,
0.6425527334213257,
... |
javascript/reference/global_objects/asyncdisposablestack/move/index.md | JavaScript - Global Objects - AsyncDisposableStack - move - Examples - Claiming ownership of a stack:
Example:
async function consumeStack(stack) {
await using newStack = stack.move(); // newStack now owns the disposers
console.log(stack.disposed); // true
console.log(newStack.disposed); // false
// newStack ... | [
0.31019487977027893,
-0.04728064313530922,
-0.9461487531661987,
0.5848467350006104,
-0.5790388584136963,
-1.3437895774841309,
-0.44023826718330383,
0.5220541954040527,
-0.10782463848590851,
0.6367199420928955,
0.11517417430877686,
-0.014640380628407001,
-1.0824428796768188,
0.4562398195266... |
javascript/reference/global_objects/asyncdisposablestack/move/index.md | JavaScript - Global Objects - AsyncDisposableStack - move - Examples - Allowing resources to be disposed within two code paths:
The major use case of `move()` is when you have one or more resources which could either be disposed right here or could be persisted for later use. In this case, you can put the resources in... | [
0.07896927744150162,
0.3075249493122101,
-0.15182678401470184,
1.126117467880249,
0.40885868668556213,
-0.4136233925819397,
-0.33352968096733093,
0.8290830254554749,
-1.012977123260498,
0.11215721815824509,
-0.5442255735397339,
0.30291998386383057,
-0.5311591029167175,
0.26560136675834656,... |
javascript/reference/global_objects/infinity/index.md | JavaScript - Global Objects - Infinity:
The `Infinity` global property is a numeric value representing infinity.
Example:
const maxNumber = 10 ** 1000; // Max positive number
if (maxNumber === Infinity) {
console.log("Let's call it Infinity!");
// Expected output: "Let's call it Infinity!"
}
console.log(1 / ma... | [
-1.0563867092132568,
-0.1315382719039917,
-0.5834537744522095,
0.31292933225631714,
-0.6875444650650024,
-1.9675785303115845,
-0.6483482718467712,
-0.04840622842311859,
1.1932867765426636,
-0.05757275968790054,
-0.7378086447715759,
0.6523006558418274,
-0.37596550583839417,
-0.2742322683334... |
javascript/reference/global_objects/infinity/index.md | JavaScript - Global Objects - Infinity - Value:
The same number value as `Number.POSITIVE_INFINITY`. | [
-1.2205065488815308,
-0.12942077219486237,
-0.08416248112916946,
-0.6101129055023193,
-0.7135965824127197,
-2.088818311691284,
0.8268756866455078,
0.13165180385112762,
-0.05775335431098938,
-0.38002288341522217,
-0.7492871880531311,
-0.5068172216415405,
0.34960663318634033,
0.0541623122990... |
javascript/reference/global_objects/infinity/index.md | JavaScript - Global Objects - Infinity - Description:
`Infinity` is a property of the global object. In other words, it is a variable in global scope.
The value `Infinity` (positive infinity) is greater than any other number.
This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_IN... | [
-1.2363215684890747,
-0.3791511654853821,
-0.5846763849258423,
0.03703963756561279,
-0.4522317349910736,
-2.305150270462036,
-0.13686878979206085,
0.0875253677368164,
0.9929397702217102,
-0.43266963958740234,
-1.1496241092681885,
-0.03768155723810196,
-0.021812845021486282,
-0.242063879966... |
javascript/reference/global_objects/infinity/index.md | JavaScript - Global Objects - Infinity - Examples - Using Infinity:
Example:
console.log(Infinity); /* Infinity */
console.log(Infinity + 1); /* Infinity */
console.log(10 ** 1000); /* Infinity */
console.log(Math.log(0)); /* -Infinity */
console.log(1 / Infinity); /* 0 */
console.log(1 / 0); /* Infinity */ | [
-0.6691927909851074,
0.18946729600429535,
-0.904537558555603,
0.5589998960494995,
-0.6502217054367065,
-2.2239811420440674,
0.4856245815753937,
-0.2737337648868561,
0.20177416503429413,
-0.6844763159751892,
0.6884655356407166,
0.21343153715133667,
0.2750319540500641,
-0.504927396774292,
... |
javascript/reference/global_objects/error/stacktracelimit/index.md | JavaScript - Global Objects - Error - stackTraceLimit:
Non-standard: This feature is not standardized.
Note: This feature is part of the currently non-standard V8 stack trace API. However, for compatibility reasons, it is also implemented by JavaScriptCore.
The `Error.stackTraceLimit` static data property indicates ... | [
-0.44249045848846436,
-1.7730305194854736,
-0.9547393321990967,
0.029728060588240623,
-0.1910039484500885,
-0.9494672417640686,
0.3032695949077606,
0.1768675595521927,
-0.08844830095767975,
0.07194148749113083,
-1.2235957384109497,
-0.06565442681312561,
0.7827520966529846,
0.73662805557250... |
javascript/reference/global_objects/error/stacktracelimit/index.md | JavaScript - Global Objects - Error - stackTraceLimit - Value:
An integer representing the maximum number of stack frames captured by the stack trace of an error. | [
-0.12311665713787079,
-1.8271335363388062,
-0.8953156471252441,
-0.48866352438926697,
-0.40464282035827637,
-0.7079463005065918,
-0.20217284560203552,
0.34508466720581055,
-0.01468522846698761,
-0.5676918625831604,
-1.0996330976486206,
0.0049022105522453785,
0.5009521842002869,
0.858428180... |
javascript/reference/global_objects/error/stacktracelimit/index.md | JavaScript - Global Objects - Error - stackTraceLimit - Description:
Because `stackTraceLimit` is a static property of `Error`, you always use it as `Error.stackTraceLimit`, rather than as a property of an `Error` object you created. If you want to customize the stack trace for a single error only, you may need to set... | [
-0.6619502305984497,
-1.2378181219100952,
-0.5346666574478149,
0.23359227180480957,
0.32370811700820923,
-2.0026540756225586,
0.19484058022499084,
0.26330578327178955,
0.08796431869268417,
0.03445717319846153,
-1.0653460025787354,
0.45520347356796265,
0.6383008360862732,
0.3135043382644653... |
javascript/reference/global_objects/error/stacktracelimit/index.md | JavaScript - Global Objects - Error - stackTraceLimit - Examples - Setting Error.stackTraceLimit:
This code is safe to run even in environments that don't support `Error.stackTraceLimit`, because it doesn't read the property, only sets it, and engines that don't support it will ignore the setting.
Example:
Error.sta... | [
-0.03122781217098236,
-1.203020691871643,
-1.1257426738739014,
0.023010406643152237,
-0.16111552715301514,
-1.1828423738479614,
0.04562100023031235,
-0.20135924220085144,
-0.039995525032281876,
0.036992624402046204,
-1.1533418893814087,
-0.13319264352321625,
1.152659296989441,
-0.185205936... |
javascript/reference/global_objects/error/name/index.md | JavaScript - Global Objects - Error - name:
The `name` data property of `Error.prototype` is shared by all `Error` instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like `TypeError` and `SyntaxError` provide their own `name` properties. | [
-0.6853505969047546,
-1.2264587879180908,
-0.7170717716217041,
0.12691868841648102,
-0.2625490725040436,
-1.1326245069503784,
1.0467960834503174,
0.6413375735282898,
-0.36430007219314575,
-0.8749024868011475,
-0.9548790454864502,
-0.05257914215326309,
-0.3371272087097168,
-0.04265560209751... |
javascript/reference/global_objects/error/name/index.md | JavaScript - Global Objects - Error - name - Value:
A string. For `Error.prototype.name`, the initial value is `"Error"`. | [
-0.4278090000152588,
-0.8814743161201477,
-0.08768494427204132,
-0.4842909574508667,
-0.26377296447753906,
-1.232122778892517,
0.8738853335380554,
0.5013043284416199,
-0.6577256321907043,
-0.6438357830047607,
-0.5913187265396118,
-0.45257046818733215,
-0.2770515978336334,
-0.56884223222732... |
javascript/reference/global_objects/error/name/index.md | JavaScript - Global Objects - Error - name - Description:
By default, `Error` instances are given the name "Error". The `name` property, in addition to the `message` property, is used by the `Error.prototype.toString()` method to create a string representation of the error. | [
-0.3538515865802765,
-0.8749535083770752,
-0.7283837795257568,
0.17709825932979584,
0.09197867661714554,
-1.55632483959198,
0.5084543228149414,
0.3150148391723633,
-0.457535058259964,
-0.641275942325592,
-0.8631895184516907,
-0.08372030407190323,
-0.23541849851608276,
0.5762161612510681,
... |
javascript/reference/global_objects/error/name/index.md | JavaScript - Global Objects - Error - name - Examples - Throwing a custom error:
Example:
const e = new Error("Malformed input"); // e.name is 'Error'
e.name = "ParseError";
throw e;
// e.toString() would return 'ParseError: Malformed input' | [
0.11912361532449722,
-0.07627178728580475,
-0.5257524847984314,
0.4460214078426361,
-0.30617842078208923,
-1.7433680295944214,
0.5405982136726379,
0.22271613776683807,
-1.0383533239364624,
-0.11027579009532928,
-0.7009998559951782,
0.12124328315258026,
-0.01494328398257494,
-0.630501329898... |
javascript/reference/global_objects/error/stack/index.md | JavaScript - Global Objects - Error - stack:
Non-standard: This feature is not standardized.
Note: The `stack` property is de facto implemented by all major JavaScript engines, and the JavaScript standards committee is looking to standardize it. You cannot rely on the precise content of the stack string due to implem... | [
-0.49092555046081543,
-0.6360471844673157,
-1.3113088607788086,
-0.04861891269683838,
0.40798261761665344,
-1.6106668710708618,
0.569088339805603,
0.2710759937763214,
-0.7683001756668091,
0.21794237196445465,
-0.3089621365070343,
0.2722989320755005,
0.11963217705488205,
0.8331916332244873,... |
javascript/reference/global_objects/error/stack/index.md | JavaScript - Global Objects - Error - stack - Value:
A string.
Because the `stack` property is non-standard, implementations differ about where it's installed.
- In Firefox, it's an accessor property on `Error.prototype`.
- In Chrome and Safari, it's a data property on each `Error` instance, with the descriptor: | [
-0.5448604226112366,
-1.624163031578064,
-0.6090101599693298,
-0.11939247697591782,
0.3608044385910034,
-1.5618394613265991,
0.7019233703613281,
0.4802095890045166,
0.005836764816194773,
-0.013807601295411587,
-0.4792376458644867,
0.10029706358909607,
-0.601944625377655,
0.1905935406684875... |
javascript/reference/global_objects/error/stack/index.md | JavaScript - Global Objects - Error - stack - Description:
Each JavaScript engine uses its own format for stack traces, but they are fairly consistent in their high-level structure. Every implementation uses a separate line in the stack to represent each function call. The call that directly caused the error is placed... | [
0.5084700584411621,
-0.5633343458175659,
-0.6610862016677856,
0.15313054621219635,
0.9209628701210022,
-1.0321645736694336,
0.31404396891593933,
0.6432751417160034,
-0.4784674048423767,
0.11239572614431381,
-0.16784779727458954,
0.5763372182846069,
0.8407692313194275,
0.6988635063171387,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.