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

Forced replacement prototype accessors methods fails Android 4.0 #232

Closed
ikhilko opened this issue Aug 26, 2016 · 1 comment
Closed

Forced replacement prototype accessors methods fails Android 4.0 #232

ikhilko opened this issue Aug 26, 2016 · 1 comment

Comments

@ikhilko
Copy link

ikhilko commented Aug 26, 2016

We are using babel-polyfill in our code, and it loads core-js as dependency.
Unfortunately core-js fails application for Android 4.0. After some investigation i found the problem place, but have no idea why problem occurred here:

// Forced replacement prototype accessors methods
module.exports = require('./_library')|| !require('./_fails')(function(){
  var K = Math.random();
  // In FF throws only define methods
  __defineSetter__.call(null, K, function(){ /* empty */});
  delete require('./_global')[K];
});

Browser's engine raised "Uncaught illegal access" exception that for some magic reasons doesn't catched by try/catch while execution line:

__defineSetter__.call(null, K, function(){ /* empty */});

I have tried to replace this line with:

var obj = {};
__defineSetter__.call(obj, K, function(){ /* empty */});
delete obj[K];

and this fixed the problem, but i'm not sure that this is a right solution. So can anyone help me to solve this problem?

@lnwu
Copy link

lnwu commented Sep 25, 2019

Same issue in ios 10.3 iphone7 simulator

__defineSetter__.call(null, "test", function () { /* empty */ });

TypeError: null is not an object (evaluating '__defineSetter__.call(null, "test", function () { /* empty */ })')

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

3 participants