Closed
Bug 1381295
Opened 8 years ago
Closed 8 years ago
String.charCodeAt() doesn't exist
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: jmichae3, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0
Build ID: 20170628075643
Steps to reproduce:
String.charCodeAt(34)
Actual results:
51
String.charCodeAt is deprecated; use String.prototype.charCodeAt instead
Expected results:
should have worked. code point API not completely there yet, 1 String method missing.
| Reporter | ||
Comment 1•8 years ago
|
||
ReferenceError: charCodeAt is not defined[Learn More]
Comment 2•8 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Resolution: --- → INVALID
| Reporter | ||
Comment 3•8 years ago
|
||
wow the guy that made that web page was grumpy. that's like removing String and Array and expecting something good from it.
I think my report here was based on a mistake in code by not starting from a string I saw something like fromCodeAt or something like that. but that web page is a major red warning bells alarm to me.
| Reporter | ||
Comment 4•8 years ago
|
||
removing those is a bad idea, since there is no functionally-equivalent replacement. indexOf does NOT work the same as .search for example. I did a search and replace in my code, and my code went bonkers.
NS browser invented Javascript. I don't think it should be just thrown away so lightly. shouldn't ff be the standard now that it has replaced NS? please don't throw away a useful language at the ecma and trash JS anymore.
Comment 5•8 years ago
|
||
(In reply to Jim Michaels from comment #4)
> removing those is a bad idea, since there is no functionally-equivalent
> replacement. indexOf does NOT work the same as .search for example. I did a
> search and replace in my code, and my code went bonkers.
I'm not sure what you're saying here. String.prototype.indexOf will never be removed, so why would you try to replace it with String.prototype.search? String.indexOf will be removed - just as String.search and all the other static functions on String and Array that just forward to .prototype versions.
> NS browser invented Javascript. I don't think it should be just thrown away
> so lightly. shouldn't ff be the standard now that it has replaced NS? please
> don't throw away a useful language at the ecma and trash JS anymore.
"The standard" isn't supposed to be a single browser, regardless of which one it'd be. It's the set of interoperable functionality implemented in all browsers with any meaningful market share, ideally codified in a formal standard such as ECMAScript. This set should ideally approach 100% of all functionality implemented in any of those browsers. We're not at all interested in extending the ways in which content authors could write code that only works in Firefox, not other browsers.
You need to log in
before you can comment on or make changes to this bug.
Description
•