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

built-in ES6 typedArray names #2920

Closed
leobalter opened this issue Apr 28, 2016 · 8 comments
Closed

built-in ES6 typedArray names #2920

leobalter opened this issue Apr 28, 2016 · 8 comments

Comments

@leobalter
Copy link
Contributor

With the exception of ArrayBufferView the typedArray global names (including ArrayBuffer and DataView) should be considered when setting esversion: 6.

Ref:

jshint/src/jshint.js

Lines 211 to 213 in b1c8d5b

if (state.inES6()) {
combine(predefined, vars.ecmaIdentifiers[6]);
}

@jugglinmike
Copy link
Member

Thanks for the report! You're right: we need to extend the global identifiers for ES2015 environments.

In the mean time, you may use the typed environment option as a shorthand to introduce those identifiers.

@sstern6
Copy link
Contributor

sstern6 commented Jul 27, 2016

@jugglinmike && @leobalter if no one has started on this I would like to make a PR for this issue.

From what I understand we would just need to add ArrayBuffer and DataView here as keys with values of false?

6: {

Let me know if I can take this one and if this seems like the correct general approach.

Thank you

@leobalter
Copy link
Contributor Author

leobalter commented Jul 27, 2016

This is the list:

jshint/src/vars.js

Lines 540 to 553 in b1c8d5b

exports.typed = {
ArrayBuffer : false,
ArrayBufferView : false,
DataView : false,
Float32Array : false,
Float64Array : false,
Int16Array : false,
Int32Array : false,
Int8Array : false,
Uint16Array : false,
Uint32Array : false,
Uint8Array : false,
Uint8ClampedArray : false
};

The only item that is not an ES6 global is ArrayBufferView, the others are valid globals.

@sstern6
Copy link
Contributor

sstern6 commented Jul 27, 2016

Sorry misunderstood, thank you, so then ArrayBufferView would be added to the list of ecmaidentifiers['6'] on line 44 to confirm?

@leobalter
Copy link
Contributor Author

actually is the opposite. The items that should be added to ecmaidentifiers['6'] are:

  • ArrayBuffer
  • DataView
  • Int8Array
  • Int16Array
  • Int32Array
  • Uint8Array
  • Uint16Array
  • Uint32Array
  • Uint8ClampledArray
  • Float32Array
  • Float64Array

@sstern6
Copy link
Contributor

sstern6 commented Jul 28, 2016

Got it, thank you will have a PR open in the next day or so

@sstern6
Copy link
Contributor

sstern6 commented Aug 2, 2016

@leobalter && @jugglinmike PR open for this issue, let me know if anything else is needed. Thank you

@jugglinmike
Copy link
Member

Resolved via gh-2995.

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