Unexpected Token '>' Using Array.some () with Karma and PhantomJS

I get the following error:

PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR
   SyntaxError: Unexpected token '>'
   at myAngularControllerPath.js:9

Moving to this file, I find that I am using the Array.some () function as follows:

return list.some(x => isListItemGood(x));

When I start Karma with Chrome specified in the karma.conf.js file, I do not get this error.

According to http://kangax.imtqy.com/compat-table/es5/ , PhantomJS supports all 10 new ES5 and Array.some () array functions introduced in ES5 according to https://developer.mozilla.org/en -US / docs / Web / JavaScript / Reference / Global_Objects / Array / some . I installed PhantomJS using "npm install --save-dev karma-phantomjs-launcher", which has 2.1.7 specified as the version of PhantomJS in its dependencies.

Thanks for any help!

+4
1

" " PhantomJS 2.x

PhantomJS ES6.

+11

Source: https://habr.com/ru/post/1651712/


All Articles