Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Cannot read property 'isNaN' of undefined #154

Open
AlikDex opened this issue Jul 10, 2019 · 5 comments
Open

Cannot read property 'isNaN' of undefined #154

AlikDex opened this issue Jul 10, 2019 · 5 comments

Comments

@AlikDex
Copy link

AlikDex commented Jul 10, 2019

Uncaught TypeError: Cannot read property 'isNaN' of undefined

https://github.com/inexorabletash/polyfill/blob/master/polyfill.js#L565

Use babel 7.5.6 and @babel/env preset.

What's wrong?

@inexorabletash
Copy link
Owner

That would happen if a global self is not defined. self is always defined in Window and Worker contexts. Presumably you're trying this outside a browser?

@AlikDex
Copy link
Author

AlikDex commented Jul 11, 2019

In the browser.
The error appears after using babel. It cuts "self" in functions

@inexorabletash
Copy link
Owner

inexorabletash commented Jul 11, 2019 via email

@AlikDex
Copy link
Author

AlikDex commented Jul 11, 2019

The problem was found. Babel replaces })(this); with })(void 0);
Can be lead to a single standard of function? Everywhere put })(self); (processed correctly)

@Mouvedia
Copy link

Babel replaces })(this); with })(void 0);

This is probably related to "use strict";.
ref https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode#Securing_JavaScript

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

No branches or pull requests

3 participants