Closed aleen42 closed 1 year ago
I know about some specific behavior in PhantomJS's strict mode, but that looks strange since this variable is defined in the upper scope. Moreover, core-js
is tested in PhantomJS and tests passed without any problems. As an option, it can be related, for example, to a minifier. Are you sure that it's a fix for your case?
@zloirock It cannot reproduce unless eval
:
"use strict";
eval("\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js/internals/well-known-symbol.js\");\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n\n\n//# sourceURL=webpack://./node_modules/core-js/internals/check-correctness-of-iteration.js?");
It seems like a bug in PhantomJS, but I can't find any workaround except modifying it under core-js
.
I'm not sure that it's the best workaround, but let it be.
related issue: #1286