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
  • 3,832
  • 3
  • 21
  • 45

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
  • 513,640
  • 108
  • 821
  • 1,164