Discussion about global
and experimental_enhanced
#3860
Labels
evaluation needed
proposal needs to be validated or tested before fully implementing it in k6
js-compat
question
triage
What?
extended
apart from using babel (until recently) to add more ECMAScript support also addsglobal
as an alias toglobalThis
k6/js/bundle.go
Lines 387 to 392 in 111985b
This was readded after the dropping of
core-js
#1845 and is currently the sole difference betweenextended
andbase
.experimental_enhanced
doesn't add this alias.Proposal:
Keep it this way.
I would argue that we should drop it from
extended
in the future as well, but this should be discussed separately.experimental_enhanced
doesn't have a history of supporting this, and we have had in the past had problems with this being used by libraries to detect if they are running in nodejs. Which then fails as it goes down a code path that isn't actually supported.Nodejs and every other known to me engine supports
globalThis
and that is the standard way.We could potentially revise this in the future if there are cases that come to light that this will be beneficial.
The text was updated successfully, but these errors were encountered: