Browse files

Firefox 18+ supports String#startsWith, String#endsWith

  • Loading branch information...
1 parent 4ce0b0f commit fa1f8993f23a9fb51314fd18b50698a0fef9902b @victor-homyakov victor-homyakov committed Jan 24, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/prototype/lang/string.js
View
5 src/prototype/lang/string.js
@@ -878,8 +878,9 @@ Object.extend(String.prototype, (function() {
isJSON: isJSON,
evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
include: include,
- startsWith: startsWith,
- endsWith: endsWith,
+ // Firefox 18+ supports String.prototype.startsWith, String.prototype.endsWith
+ startsWith: String.prototype.startsWith || startsWith,
+ endsWith: String.prototype.endsWith || endsWith,
@jdalton
jdalton added a note Apr 11, 2014

Should also be noted that Prototype's startsWith and endsWith does not align with ES6. It's missing support for the position argument.

@jdalton
jdalton added a note Apr 11, 2014

NM, I see edge has added support for position but isn't totally accurate around resolving the position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
empty: empty,
blank: blank,
interpolate: interpolate

0 comments on commit fa1f899

Please sign in to comment.