0

I'm using UglifyJS to transpile a React web app, and I noticed that it seems to wrap a lot of function calls, specifically functions imported from another module/file, with (0, and ). What is the point of this?

Example: It transpiles this

var longVariableName = someFunction(some, arguments)

to this

var t = (0, v.someFunction)(some, arguments)
ahstro
  • 4,572
  • 4
  • 25
  • 49

1 Answers1

1

It ensures that the this context in someFunction is undefined just like in the original call, not v, as it would be in the method call v.someFunction(some, arguments).

Bergi
  • 572,313
  • 128
  • 898
  • 1,281