-
• #2
This'll be the JSHint (the lint plugin for the Web IDE) picking up on something.
__proto__
isn't deprecated in Espruino, although I guessObject.getPrototypeOf
should be added at some point. -
• #3
So it's just the linter bitching about
__proto__
- Is it actually officially deprecated anywhere or anything, or do they just not like it because it doesn't feel JS-y enough?Object.getPrototypeOf is not listed in the reference, so it's no surprise that it's not implemented (the reference list is exhaustive, right? I think it's autogenerated so all methodscd show up, even if there's no info on them).
Edit: beaten....
-
• #4
Thanks. I like the light-weight
obj.__proto__
property accessor but understand why it got deprecated and replaced withObject.getPrototypeOf(obj)
method.I see the challenge of keeping up with JS ECMA... and it will get more intense... ES6... 7. But it is for sure fun and you - including every one else - will not get bored...
-
• #5
I'm now thinking IDE could use a (user configurable) profile about what is ultimately fed to the linter... (no pressure on anyone...)
-
• #6
I liked
__proto__
too, but it does feel a bit hacky :) I'll add an issue for sticking getPrototypeOf in.the reference list is exhaustive, right?
Yep, it's whatever is in the current release of Espruino, so at the moment 1v85. There may be some other stuff in the latest Git build.
about what is ultimately feed to the linter...
@allObjects - https://github.com/espruino/EspruinoWebIDE/blob/gh-pages/js/core/editorJavaScript.js#L29 :)
I'm not sure it needs to be configurable, but disabling just that warning should be easy.
Code using deprecated
__proto__
(see screenshot) works:Console output:
Code 'correctly' getting prototype:
Console output:
1 Attachment