hound icon indicating copy to clipboard operation
hound copied to clipboard

How to sideload PhantomJS Polyfills?

Open fahrradflucht opened this issue 8 years ago • 3 comments

I get:

TypeError: undefined is not a constructor (evaluating 'Object.assign({}, state, {
            isFetching: true
          })')

from PhantomJS because Object.assign() seems to be missing. I would like to polyfill it, for example with phantomjs-polyfill-object-assign.

As declared in the Readme of the mentioned project, in Karma you are able to sideload javascript files into Phantom/the page. How would one go about that with hound?

I know polyfilling Object.assign isn't that much code so I could probably do it in the project itself but I would rather not do it if it isn't necessary.

fahrradflucht avatar Jul 30 '16 17:07 fahrradflucht

IIRC, PhantomJS 2 should support Object.assign correctly.

Otherwise, I suggest you just add the polyfill to your project, as I do not think this is really the job of Hound, which is an interface to an external webdriver.

@HashNuke What do you think?

danhper avatar Aug 02 '16 06:08 danhper

I use PhantomJS 2 it neither supports Object.assign nor Promises.

I think it's a valid feature for hound to support polyfilling the web driver environment for cases were PhantomJS lags behind the minimum browser versions you would like to support. How is hound different then Karma in that perspective?

fahrradflucht avatar Aug 02 '16 06:08 fahrradflucht

Looks like with Chrome and Firefox working on headless modes, PhantomJs is going to be discontinued. Is this issue still relevant?

phanimahesh avatar Jun 16 '17 09:06 phanimahesh