dillon1000/react

Commit

Don't pass a null context to Function.prototype.call.

This prevents PhantomJS tests from hanging in the open-source React repo.

Until the advent of `"use strict"`, passing `null` as the context object
to `.call` or `.apply` resulted in `this` taking on the value of the
global object inside the invoked function.

Technically the `"use strict"` directive is supposed to make it possible
that `this === null`, but strict mode is not respected by all browsers,
including (unfortunately) PhantomJS.

Since these `expect`-ations are just testing binding behavior, let's not
make them also test strict mode `this` handling.
Browse files
Changed paths1 file
First-parent comparison
M src/core/__tests__/ReactCompositeComponent-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…