PhantomJS 1.9.x has a bug where the arguments and caller properties are incorrectly returned by getOwnPropertyNames() as members of strict-mode functions but accessing them results in a TypeError.
As a result, attempting to stub a module whose original module.exports is a strict-mode function will result in an error unless call-through to the original module is disabled.
I think it makes sense to patch this in https://github.com/bendrucker/phantom-ownpropertynames but it might be worth adding a check in Proxyquireify's prelude to warn if running under PhantomJS 1.9 which is still in widespread use?
PhantomJS 1.9.x has a bug where the
arguments
andcaller
properties are incorrectly returned bygetOwnPropertyNames()
as members of strict-mode functions but accessing them results in aTypeError
.As a result, attempting to stub a module whose original
module.exports
is a strict-mode function will result in an error unless call-through to the original module is disabled.I think it makes sense to patch this in https://github.com/bendrucker/phantom-ownpropertynames but it might be worth adding a check in Proxyquireify's prelude to warn if running under PhantomJS 1.9 which is still in widespread use?