cdk-common 2.0.299 → 2.0.301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.jsii +26 -2
  2. package/API.md +20 -0
  3. package/lib/main.js +1 -1
  4. package/lib/managed-policies.d.ts +4 -0
  5. package/lib/managed-policies.js +5 -1
  6. package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
  7. package/node_modules/@types/concat-stream/node_modules/@types/node/globals.d.ts +1 -1
  8. package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +7 -0
  9. package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
  10. package/node_modules/@types/concat-stream/node_modules/@types/node/ts4.8/http.d.ts +7 -0
  11. package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
  12. package/node_modules/@types/form-data/node_modules/@types/node/globals.d.ts +1 -1
  13. package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +7 -0
  14. package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
  15. package/node_modules/@types/form-data/node_modules/@types/node/ts4.8/http.d.ts +7 -0
  16. package/node_modules/@types/node/README.md +1 -1
  17. package/node_modules/@types/node/globals.d.ts +1 -1
  18. package/node_modules/@types/node/package.json +2 -2
  19. package/node_modules/promise/Readme.md +14 -0
  20. package/node_modules/promise/domains/core.js +39 -39
  21. package/node_modules/promise/domains/es6-extensions.js +51 -7
  22. package/node_modules/promise/domains/rejection-tracking.js +14 -14
  23. package/node_modules/promise/domains/synchronous.js +10 -10
  24. package/node_modules/promise/index.d.ts +15 -0
  25. package/node_modules/promise/lib/core.js +39 -39
  26. package/node_modules/promise/lib/es6-extensions.js +51 -7
  27. package/node_modules/promise/lib/rejection-tracking.js +14 -14
  28. package/node_modules/promise/lib/synchronous.js +10 -10
  29. package/node_modules/promise/package.json +1 -1
  30. package/node_modules/promise/setimmediate/core.js +39 -39
  31. package/node_modules/promise/setimmediate/es6-extensions.js +51 -7
  32. package/node_modules/promise/setimmediate/rejection-tracking.js +14 -14
  33. package/node_modules/promise/setimmediate/synchronous.js +10 -10
  34. package/node_modules/promise/src/es6-extensions.js +44 -0
  35. package/package.json +2 -2
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 24 Oct 2022 23:32:48 GMT
11
+ * Last updated: Wed, 26 Oct 2022 20:32:58 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
@@ -76,7 +76,7 @@ declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal:
76
76
  : {
77
77
  prototype: AbortSignal;
78
78
  new(): AbortSignal;
79
- // TODO: Add abort() static
79
+ abort(reason?: any): AbortSignal;
80
80
  timeout(milliseconds: number): AbortSignal;
81
81
  };
82
82
  //#endregion borrowed
@@ -1595,6 +1595,13 @@ declare module 'http' {
1595
1595
  */
1596
1596
  function validateHeaderValue(name: string, value: string): void;
1597
1597
 
1598
+ /**
1599
+ * Set the maximum number of idle HTTP parsers. Default: 1000.
1600
+ * @param count
1601
+ * @since v18.8.0, v16.18.0
1602
+ */
1603
+ function setMaxIdleHTTPParsers(count: number): void;
1604
+
1598
1605
  let globalAgent: Agent;
1599
1606
  /**
1600
1607
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.11.5",
3
+ "version": "18.11.7",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "789f85299ef1242ce3a980c6492790dbe838ee703cbb6ac4696f979006e9a7ef",
230
+ "typesPublisherContentHash": "e64a34cfa8ad95a9b0e877bc576e260483e6152920c5641be7813e087342864a",
231
231
  "typeScriptVersion": "4.1"
232
232
  }
@@ -1595,6 +1595,13 @@ declare module 'http' {
1595
1595
  */
1596
1596
  function validateHeaderValue(name: string, value: string): void;
1597
1597
 
1598
+ /**
1599
+ * Set the maximum number of idle HTTP parsers. Default: 1000.
1600
+ * @param count
1601
+ * @since v18.8.0, v16.18.0
1602
+ */
1603
+ function setMaxIdleHTTPParsers(count: number): void;
1604
+
1598
1605
  let globalAgent: Agent;
1599
1606
  /**
1600
1607
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 24 Oct 2022 23:32:48 GMT
11
+ * Last updated: Wed, 26 Oct 2022 20:32:58 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
@@ -76,7 +76,7 @@ declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal:
76
76
  : {
77
77
  prototype: AbortSignal;
78
78
  new(): AbortSignal;
79
- // TODO: Add abort() static
79
+ abort(reason?: any): AbortSignal;
80
80
  timeout(milliseconds: number): AbortSignal;
81
81
  };
82
82
  //#endregion borrowed
@@ -1595,6 +1595,13 @@ declare module 'http' {
1595
1595
  */
1596
1596
  function validateHeaderValue(name: string, value: string): void;
1597
1597
 
1598
+ /**
1599
+ * Set the maximum number of idle HTTP parsers. Default: 1000.
1600
+ * @param count
1601
+ * @since v18.8.0, v16.18.0
1602
+ */
1603
+ function setMaxIdleHTTPParsers(count: number): void;
1604
+
1598
1605
  let globalAgent: Agent;
1599
1606
  /**
1600
1607
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.11.5",
3
+ "version": "18.11.7",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "789f85299ef1242ce3a980c6492790dbe838ee703cbb6ac4696f979006e9a7ef",
230
+ "typesPublisherContentHash": "e64a34cfa8ad95a9b0e877bc576e260483e6152920c5641be7813e087342864a",
231
231
  "typeScriptVersion": "4.1"
232
232
  }
@@ -1595,6 +1595,13 @@ declare module 'http' {
1595
1595
  */
1596
1596
  function validateHeaderValue(name: string, value: string): void;
1597
1597
 
1598
+ /**
1599
+ * Set the maximum number of idle HTTP parsers. Default: 1000.
1600
+ * @param count
1601
+ * @since v18.8.0, v16.18.0
1602
+ */
1603
+ function setMaxIdleHTTPParsers(count: number): void;
1604
+
1598
1605
  let globalAgent: Agent;
1599
1606
  /**
1600
1607
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 10 Oct 2022 21:33:34 GMT
11
+ * Last updated: Wed, 26 Oct 2022 20:33:01 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
@@ -114,7 +114,7 @@ declare var AbortController: {
114
114
  declare var AbortSignal: {
115
115
  prototype: AbortSignal;
116
116
  new(): AbortSignal;
117
- // TODO: Add abort() static
117
+ abort(reason?: any): AbortSignal;
118
118
  timeout(milliseconds: number): AbortSignal;
119
119
  };
120
120
  //#endregion borrowed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.18.32",
3
+ "version": "14.18.33",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "dc34a71dfe14ccd84c65e67272875f0c481b754fb1306d2d07712ee664154e50",
230
+ "typesPublisherContentHash": "132921d8fea35693f1adaf8d9110efe9ffdd29c6863478ce1130b46dae22336a",
231
231
  "typeScriptVersion": "4.1"
232
232
  }
@@ -141,6 +141,20 @@ Promise.all([Promise.resolve('a'), 'b', Promise.resolve('c')])
141
141
  })
142
142
  ```
143
143
 
144
+ #### Promise.any(array)
145
+
146
+ Returns a single promise that fulfills as soon as any of the promises in the iterable fulfills, with the value of the fulfilled promise. If no promises in the iterable fulfill (if all of the given promises are rejected), then the returned promise is rejected with an `AggregateError`
147
+
148
+ ```js
149
+ var rejected = Promise.reject(0);
150
+ var first = new Promise(function (resolve){ setTimeout(resolve, 100, 'quick') });
151
+ var second = new Promise(function (resolve){ setTimeout(resolve, 500, 'slow') });
152
+
153
+ var promises = [rejected, first, second];
154
+
155
+ Promise.any(promises) // => succeeds with `quick`
156
+ ```
157
+
144
158
  #### Promise.allSettled(array)
145
159
 
146
160
  Returns a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describes the outcome of each promise.
@@ -58,16 +58,16 @@ function Promise(fn) {
58
58
  if (typeof fn !== 'function') {
59
59
  throw new TypeError('Promise constructor\'s argument is not a function');
60
60
  }
61
- this._1 = 0;
62
- this._2 = 0;
63
- this._3 = null;
64
- this._4 = null;
61
+ this._x = 0;
62
+ this._y = 0;
63
+ this._z = null;
64
+ this._A = null;
65
65
  if (fn === noop) return;
66
66
  doResolve(fn, this);
67
67
  }
68
- Promise._5 = null;
69
- Promise._6 = null;
70
- Promise._7 = noop;
68
+ Promise._B = null;
69
+ Promise._C = null;
70
+ Promise._D = noop;
71
71
 
72
72
  Promise.prototype.then = function(onFulfilled, onRejected) {
73
73
  if (this.constructor !== Promise) {
@@ -86,24 +86,24 @@ function safeThen(self, onFulfilled, onRejected) {
86
86
  });
87
87
  }
88
88
  function handle(self, deferred) {
89
- while (self._2 === 3) {
90
- self = self._3;
89
+ while (self._y === 3) {
90
+ self = self._z;
91
91
  }
92
- if (Promise._5) {
93
- Promise._5(self);
92
+ if (Promise._B) {
93
+ Promise._B(self);
94
94
  }
95
- if (self._2 === 0) {
96
- if (self._1 === 0) {
97
- self._1 = 1;
98
- self._4 = deferred;
95
+ if (self._y === 0) {
96
+ if (self._x === 0) {
97
+ self._x = 1;
98
+ self._A = deferred;
99
99
  return;
100
100
  }
101
- if (self._1 === 1) {
102
- self._1 = 2;
103
- self._4 = [self._4, deferred];
101
+ if (self._x === 1) {
102
+ self._x = 2;
103
+ self._A = [self._A, deferred];
104
104
  return;
105
105
  }
106
- self._4.push(deferred);
106
+ self._A.push(deferred);
107
107
  return;
108
108
  }
109
109
  handleResolved(self, deferred);
@@ -111,16 +111,16 @@ function handle(self, deferred) {
111
111
 
112
112
  function handleResolved(self, deferred) {
113
113
  asap(function() {
114
- var cb = self._2 === 1 ? deferred.onFulfilled : deferred.onRejected;
114
+ var cb = self._y === 1 ? deferred.onFulfilled : deferred.onRejected;
115
115
  if (cb === null) {
116
- if (self._2 === 1) {
117
- resolve(deferred.promise, self._3);
116
+ if (self._y === 1) {
117
+ resolve(deferred.promise, self._z);
118
118
  } else {
119
- reject(deferred.promise, self._3);
119
+ reject(deferred.promise, self._z);
120
120
  }
121
121
  return;
122
122
  }
123
- var ret = tryCallOne(cb, self._3);
123
+ var ret = tryCallOne(cb, self._z);
124
124
  if (ret === IS_ERROR) {
125
125
  reject(deferred.promise, LAST_ERROR);
126
126
  } else {
@@ -148,8 +148,8 @@ function resolve(self, newValue) {
148
148
  then === self.then &&
149
149
  newValue instanceof Promise
150
150
  ) {
151
- self._2 = 3;
152
- self._3 = newValue;
151
+ self._y = 3;
152
+ self._z = newValue;
153
153
  finale(self);
154
154
  return;
155
155
  } else if (typeof then === 'function') {
@@ -157,29 +157,29 @@ function resolve(self, newValue) {
157
157
  return;
158
158
  }
159
159
  }
160
- self._2 = 1;
161
- self._3 = newValue;
160
+ self._y = 1;
161
+ self._z = newValue;
162
162
  finale(self);
163
163
  }
164
164
 
165
165
  function reject(self, newValue) {
166
- self._2 = 2;
167
- self._3 = newValue;
168
- if (Promise._6) {
169
- Promise._6(self, newValue);
166
+ self._y = 2;
167
+ self._z = newValue;
168
+ if (Promise._C) {
169
+ Promise._C(self, newValue);
170
170
  }
171
171
  finale(self);
172
172
  }
173
173
  function finale(self) {
174
- if (self._1 === 1) {
175
- handle(self, self._4);
176
- self._4 = null;
174
+ if (self._x === 1) {
175
+ handle(self, self._A);
176
+ self._A = null;
177
177
  }
178
- if (self._1 === 2) {
179
- for (var i = 0; i < self._4.length; i++) {
180
- handle(self, self._4[i]);
178
+ if (self._x === 2) {
179
+ for (var i = 0; i < self._A.length; i++) {
180
+ handle(self, self._A[i]);
181
181
  }
182
- self._4 = null;
182
+ self._A = null;
183
183
  }
184
184
  }
185
185
 
@@ -16,9 +16,9 @@ var ZERO = valuePromise(0);
16
16
  var EMPTYSTRING = valuePromise('');
17
17
 
18
18
  function valuePromise(value) {
19
- var p = new Promise(Promise._7);
20
- p._2 = 1;
21
- p._3 = value;
19
+ var p = new Promise(Promise._D);
20
+ p._y = 1;
21
+ p._z = value;
22
22
  return p;
23
23
  }
24
24
  Promise.resolve = function (value) {
@@ -67,11 +67,11 @@ Promise.all = function (arr) {
67
67
  function res(i, val) {
68
68
  if (val && (typeof val === 'object' || typeof val === 'function')) {
69
69
  if (val instanceof Promise && val.then === Promise.prototype.then) {
70
- while (val._2 === 3) {
71
- val = val._3;
70
+ while (val._y === 3) {
71
+ val = val._z;
72
72
  }
73
- if (val._2 === 1) return res(i, val._3);
74
- if (val._2 === 2) reject(val._3);
73
+ if (val._y === 1) return res(i, val._z);
74
+ if (val._y === 2) reject(val._z);
75
75
  val.then(function (val) {
76
76
  res(i, val);
77
77
  }, reject);
@@ -140,3 +140,47 @@ Promise.race = function (values) {
140
140
  Promise.prototype['catch'] = function (onRejected) {
141
141
  return this.then(null, onRejected);
142
142
  };
143
+
144
+ function getAggregateError(errors){
145
+ if(typeof AggregateError === 'function'){
146
+ return new AggregateError(errors,'All promises were rejected');
147
+ }
148
+
149
+ var error = new Error('All promises were rejected');
150
+
151
+ error.name = 'AggregateError';
152
+ error.errors = errors;
153
+
154
+ return error;
155
+ }
156
+
157
+ Promise.any = function promiseAny(values) {
158
+ return new Promise(function(resolve, reject) {
159
+ var promises = iterableToArray(values);
160
+ var hasResolved = false;
161
+ var rejectionReasons = [];
162
+
163
+ function resolveOnce(value) {
164
+ if (!hasResolved) {
165
+ hasResolved = true;
166
+ resolve(value);
167
+ }
168
+ }
169
+
170
+ function rejectionCheck(reason) {
171
+ rejectionReasons.push(reason);
172
+
173
+ if (rejectionReasons.length === promises.length) {
174
+ reject(getAggregateError(rejectionReasons));
175
+ }
176
+ }
177
+
178
+ if(promises.length === 0){
179
+ reject(getAggregateError(rejectionReasons));
180
+ } else {
181
+ promises.forEach(function(value){
182
+ Promise.resolve(value).then(resolveOnce, rejectionCheck);
183
+ });
184
+ }
185
+ });
186
+ };
@@ -12,8 +12,8 @@ var enabled = false;
12
12
  exports.disable = disable;
13
13
  function disable() {
14
14
  enabled = false;
15
- Promise._5 = null;
16
- Promise._6 = null;
15
+ Promise._B = null;
16
+ Promise._C = null;
17
17
  }
18
18
 
19
19
  exports.enable = enable;
@@ -24,27 +24,27 @@ function enable(options) {
24
24
  var id = 0;
25
25
  var displayId = 0;
26
26
  var rejections = {};
27
- Promise._5 = function (promise) {
27
+ Promise._B = function (promise) {
28
28
  if (
29
- promise._2 === 2 && // IS REJECTED
30
- rejections[promise._8]
29
+ promise._y === 2 && // IS REJECTED
30
+ rejections[promise._E]
31
31
  ) {
32
- if (rejections[promise._8].logged) {
33
- onHandled(promise._8);
32
+ if (rejections[promise._E].logged) {
33
+ onHandled(promise._E);
34
34
  } else {
35
- clearTimeout(rejections[promise._8].timeout);
35
+ clearTimeout(rejections[promise._E].timeout);
36
36
  }
37
- delete rejections[promise._8];
37
+ delete rejections[promise._E];
38
38
  }
39
39
  };
40
- Promise._6 = function (promise, err) {
41
- if (promise._1 === 0) { // not yet handled
42
- promise._8 = id++;
43
- rejections[promise._8] = {
40
+ Promise._C = function (promise, err) {
41
+ if (promise._x === 0) { // not yet handled
42
+ promise._E = id++;
43
+ rejections[promise._E] = {
44
44
  displayId: null,
45
45
  error: err,
46
46
  timeout: setTimeout(
47
- onUnhandled.bind(null, promise._8),
47
+ onUnhandled.bind(null, promise._E),
48
48
  // For reference errors and type errors, this almost always
49
49
  // means the programmer made a mistake, so log them after just
50
50
  // 100ms
@@ -17,38 +17,38 @@ Promise.enableSynchronous = function () {
17
17
  };
18
18
 
19
19
  Promise.prototype.getValue = function () {
20
- if (this._2 === 3) {
21
- return this._3.getValue();
20
+ if (this._y === 3) {
21
+ return this._z.getValue();
22
22
  }
23
23
 
24
24
  if (!this.isFulfilled()) {
25
25
  throw new Error('Cannot get a value of an unfulfilled promise.');
26
26
  }
27
27
 
28
- return this._3;
28
+ return this._z;
29
29
  };
30
30
 
31
31
  Promise.prototype.getReason = function () {
32
- if (this._2 === 3) {
33
- return this._3.getReason();
32
+ if (this._y === 3) {
33
+ return this._z.getReason();
34
34
  }
35
35
 
36
36
  if (!this.isRejected()) {
37
37
  throw new Error('Cannot get a rejection reason of a non-rejected promise.');
38
38
  }
39
39
 
40
- return this._3;
40
+ return this._z;
41
41
  };
42
42
 
43
43
  Promise.prototype.getState = function () {
44
- if (this._2 === 3) {
45
- return this._3.getState();
44
+ if (this._y === 3) {
45
+ return this._z.getState();
46
46
  }
47
- if (this._2 === -1 || this._2 === -2) {
47
+ if (this._y === -1 || this._y === -2) {
48
48
  return 0;
49
49
  }
50
50
 
51
- return this._2;
51
+ return this._y;
52
52
  };
53
53
  };
54
54
 
@@ -60,6 +60,21 @@ interface ThenPromiseConstructor {
60
60
  */
61
61
  new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => any): ThenPromise<T>;
62
62
 
63
+
64
+ /**
65
+ * The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
66
+ * @param values An array or iterable of Promises.
67
+ * @returns A new Promise.
68
+ */
69
+ any<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
70
+
71
+ /**
72
+ * The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
73
+ * @param values An array or iterable of Promises.
74
+ * @returns A new Promise.
75
+ */
76
+ any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>
77
+
63
78
  /**
64
79
  * Creates a Promise that is resolved with an array of results when all
65
80
  * of the provided Promises resolve or reject.
@@ -58,16 +58,16 @@ function Promise(fn) {
58
58
  if (typeof fn !== 'function') {
59
59
  throw new TypeError('Promise constructor\'s argument is not a function');
60
60
  }
61
- this._1 = 0;
62
- this._2 = 0;
63
- this._3 = null;
64
- this._4 = null;
61
+ this._x = 0;
62
+ this._y = 0;
63
+ this._z = null;
64
+ this._A = null;
65
65
  if (fn === noop) return;
66
66
  doResolve(fn, this);
67
67
  }
68
- Promise._5 = null;
69
- Promise._6 = null;
70
- Promise._7 = noop;
68
+ Promise._B = null;
69
+ Promise._C = null;
70
+ Promise._D = noop;
71
71
 
72
72
  Promise.prototype.then = function(onFulfilled, onRejected) {
73
73
  if (this.constructor !== Promise) {
@@ -86,24 +86,24 @@ function safeThen(self, onFulfilled, onRejected) {
86
86
  });
87
87
  }
88
88
  function handle(self, deferred) {
89
- while (self._2 === 3) {
90
- self = self._3;
89
+ while (self._y === 3) {
90
+ self = self._z;
91
91
  }
92
- if (Promise._5) {
93
- Promise._5(self);
92
+ if (Promise._B) {
93
+ Promise._B(self);
94
94
  }
95
- if (self._2 === 0) {
96
- if (self._1 === 0) {
97
- self._1 = 1;
98
- self._4 = deferred;
95
+ if (self._y === 0) {
96
+ if (self._x === 0) {
97
+ self._x = 1;
98
+ self._A = deferred;
99
99
  return;
100
100
  }
101
- if (self._1 === 1) {
102
- self._1 = 2;
103
- self._4 = [self._4, deferred];
101
+ if (self._x === 1) {
102
+ self._x = 2;
103
+ self._A = [self._A, deferred];
104
104
  return;
105
105
  }
106
- self._4.push(deferred);
106
+ self._A.push(deferred);
107
107
  return;
108
108
  }
109
109
  handleResolved(self, deferred);
@@ -111,16 +111,16 @@ function handle(self, deferred) {
111
111
 
112
112
  function handleResolved(self, deferred) {
113
113
  asap(function() {
114
- var cb = self._2 === 1 ? deferred.onFulfilled : deferred.onRejected;
114
+ var cb = self._y === 1 ? deferred.onFulfilled : deferred.onRejected;
115
115
  if (cb === null) {
116
- if (self._2 === 1) {
117
- resolve(deferred.promise, self._3);
116
+ if (self._y === 1) {
117
+ resolve(deferred.promise, self._z);
118
118
  } else {
119
- reject(deferred.promise, self._3);
119
+ reject(deferred.promise, self._z);
120
120
  }
121
121
  return;
122
122
  }
123
- var ret = tryCallOne(cb, self._3);
123
+ var ret = tryCallOne(cb, self._z);
124
124
  if (ret === IS_ERROR) {
125
125
  reject(deferred.promise, LAST_ERROR);
126
126
  } else {
@@ -148,8 +148,8 @@ function resolve(self, newValue) {
148
148
  then === self.then &&
149
149
  newValue instanceof Promise
150
150
  ) {
151
- self._2 = 3;
152
- self._3 = newValue;
151
+ self._y = 3;
152
+ self._z = newValue;
153
153
  finale(self);
154
154
  return;
155
155
  } else if (typeof then === 'function') {
@@ -157,29 +157,29 @@ function resolve(self, newValue) {
157
157
  return;
158
158
  }
159
159
  }
160
- self._2 = 1;
161
- self._3 = newValue;
160
+ self._y = 1;
161
+ self._z = newValue;
162
162
  finale(self);
163
163
  }
164
164
 
165
165
  function reject(self, newValue) {
166
- self._2 = 2;
167
- self._3 = newValue;
168
- if (Promise._6) {
169
- Promise._6(self, newValue);
166
+ self._y = 2;
167
+ self._z = newValue;
168
+ if (Promise._C) {
169
+ Promise._C(self, newValue);
170
170
  }
171
171
  finale(self);
172
172
  }
173
173
  function finale(self) {
174
- if (self._1 === 1) {
175
- handle(self, self._4);
176
- self._4 = null;
174
+ if (self._x === 1) {
175
+ handle(self, self._A);
176
+ self._A = null;
177
177
  }
178
- if (self._1 === 2) {
179
- for (var i = 0; i < self._4.length; i++) {
180
- handle(self, self._4[i]);
178
+ if (self._x === 2) {
179
+ for (var i = 0; i < self._A.length; i++) {
180
+ handle(self, self._A[i]);
181
181
  }
182
- self._4 = null;
182
+ self._A = null;
183
183
  }
184
184
  }
185
185