Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Property 0 not found." on Mozilla Rhino #440

Closed
Aquilosion opened this issue Oct 18, 2018 · 2 comments
Closed

"Property 0 not found." on Mozilla Rhino #440

Aquilosion opened this issue Oct 18, 2018 · 2 comments

Comments

@Aquilosion
Copy link

Aquilosion commented Oct 18, 2018

Attempting to use core-js-bundle on Mozilla Rhino causes the following error:

Property 0 not found.

Offending expression is Object('z').propertyIsEnumerable(0) in the following:

  /***/ }),
  /* 50 */
  /***/ (function(module, exports, __webpack_require__) {

  // fallback for non-array-like ES3 and non-enumerable old V8 strings
  var classof = __webpack_require__(27);
  // eslint-disable-next-line no-prototype-builtins
  module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
    return classof(it) == 'String' ? it.split('') : Object(it);
  };

This appears to be a bug in Rhino, and there's already a bug report filed against it which is about a year old.

@zloirock
Copy link
Owner

Interesting. Could you check, can this error be caught by try / catch?

@Aquilosion
Copy link
Author

Aquilosion commented Oct 22, 2018

It appears so. We've replaced the method with the following:

// eslint-disable-next-line no-prototype-builtins
try {
    module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it) {
        return classof(it) == 'String' ? it.split('') : Object(it);
    };
} catch (error) {
    console.log("Caught error:", error);
}

We're still working on our Rhino integration so I can't tell you anything more about the caught error unfortunately, but try/catch does seem to get it past there and I think it's the only problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants