@@ -21,6 +21,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
21
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23
23
IN THE SOFTWARE.
24
+
25
+ A modification is made to always reference `globalThis` instead of referencing
26
+ both `global` and `globalThis`. See #157.
24
27
*/
25
28
26
29
'use strict' ;
@@ -189,7 +192,7 @@ function copyPrototype(src, dest, prefix) {
189
192
'Reflect' ,
190
193
] . forEach ( ( name ) => {
191
194
// eslint-disable-next-line no-restricted-globals
192
- copyPropsRenamed ( global [ name ] , primordials , name ) ;
195
+ copyPropsRenamed ( globalThis [ name ] , primordials , name ) ;
193
196
} ) ;
194
197
195
198
// Create copies of intrinsic objects
@@ -230,7 +233,7 @@ function copyPrototype(src, dest, prefix) {
230
233
'WeakSet' ,
231
234
] . forEach ( ( name ) => {
232
235
// eslint-disable-next-line no-restricted-globals
233
- const original = global [ name ] ;
236
+ const original = globalThis [ name ] ;
234
237
primordials [ name ] = original ;
235
238
copyPropsRenamed ( original , primordials , name ) ;
236
239
copyPrototype ( original . prototype , primordials , `${ name } Prototype` ) ;
@@ -243,7 +246,7 @@ function copyPrototype(src, dest, prefix) {
243
246
'Promise' ,
244
247
] . forEach ( ( name ) => {
245
248
// eslint-disable-next-line no-restricted-globals
246
- const original = global [ name ] ;
249
+ const original = globalThis [ name ] ;
247
250
primordials [ name ] = original ;
248
251
copyPropsRenamedBound ( original , primordials , name ) ;
249
252
copyPrototype ( original . prototype , primordials , `${ name } Prototype` ) ;
0 commit comments