简体   繁体   中英

How to make JSLint happy about references to Uint8Array in Node.js code?

When running JSLint on my Node.js code it says that "'Uint8Array' was used before it was defined ." The Mozilla reference puts it in the "Standard built-in objects" category in ECMAScript 6, and it's supported in all the major browsers. When Ctrl -clicking in PyCharm it opens the definition in HTML5.js , and the code runs fine, so it definitely does exist in the relevant context.

Am I missing some sort of import or JavaScript idiom, or is this a bug in JSLint?

I've worked around it with /*global Uint8Array*/ for now.

Edit: Pull request with fix.

Here's your answer, if you believe the source:

When will ECMAScript v 6 become standard

Delayed again to June 2015, though you can already use many of the features today with traceur. – urish Aug 4 at 13:49

And that ECMAScript 6 is still a draft (as of 20141023 anyhow) is confirmed on the Uint8Array page you linked to, and here as well.

Forget what I said about posting on a post on the JSLint Google+ page . ;^)

Interesting and fun goose chase, though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM