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)
dontexist
  • 5,252
  • 4
  • 27
  • 51

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
  • 630,263
  • 148
  • 957
  • 1,375