* and given a safe start position. It supports insertion anywhere
* in the string, so "foo" to "fobaro" if limit is 4 will result in
* "fobo", not "foba". Basically emulating the native maxlength by
- * reconstructing where the insertion occured.
+ * reconstructing where the insertion occurred.
*
* @private
* @param {string} safeVal Known value that was previously returned by this
inpParts = [
// Same start
- newVal.substring( 0, startMatches ),
+ newVal.slice( 0, startMatches ),
// Inserted content
- newVal.substring( startMatches, newVal.length - endMatches ),
+ newVal.slice( startMatches, newVal.length - endMatches ),
// Same end
- newVal.substring( newVal.length - endMatches )
+ newVal.slice( newVal.length - endMatches )
];
// Chop off characters from the end of the "inserted content" string