1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00
Commit Graph

26 Commits

Author SHA1 Message Date
Steven Hartland
4c4631625a
fix: string lengths (#450)
Fix string lengths for strings containing code points which require a
Surrogate pair encoding in utf16.

Fixes #388
2022-11-25 21:35:14 +00:00
amartin
5b0d97091c
feat: basic non ascii support (#423)
Adds basic non ascii support including substring, substr, slice functions,
which work with runes (prevent utf-8 length).

This includes adding runes compatible functions:
* indexOf
* lastIndexOf
2021-10-19 18:51:42 +01:00
David P Hilton
8b169d526d adjusted benchmark style to match call_test.go, added benchmarks for all regex-related functions. 2016-09-24 15:29:50 -06:00
David P Hilton
5bc6a83c93 added string split benchmark 2016-09-22 15:50:54 -06:00
Robert Krimen
470b8c3b73 terst
* Update to latest github.com/robertkrimen/terst
* Clean up testing
2014-04-25 22:48:25 -07:00
Robert Krimen
1df390a237 Fix String.prototype.lastIndexOf 2014-01-24 21:20:22 -08:00
Robert Krimen
60b6d1190f Fix String.prototype.indexOf to return the right index even with an offset 2014-01-24 21:20:22 -08:00
Robert Krimen
b49fd47f78 Fix special case in String.prototype.split 2014-01-24 21:20:22 -08:00
Robert Krimen
f0aa5da996 Fix off-by-one error with $' in String.prototype.replace 2014-01-24 21:20:22 -08:00
Robert Krimen
33672f5c98 Add String.toLocaleUpperCase 2013-07-14 14:38:59 -07:00
Robert Krimen
3d883a981e Add String.toLocaleLowerCase 2013-07-14 14:35:50 -07:00
Robert Krimen
1481c43476 Add String.trim (robertkrimen) 2013-07-14 14:20:01 -07:00
Robert Krimen
19360eafc4 Add String.localeCompare 2013-07-14 14:20:01 -07:00
Tim Jurcka
dd7d387420 Add String.prototype.trim(), and non-standard trimLeft(), trimRight()
This fixes #32
2013-07-14 14:19:06 -07:00
Robert Krimen
4ebf6416d0 Fix Uint32 Array/String indexing
Also, a bunch of toValue_* streamlining
And maybe a few miscellaneous tweaks
2013-06-22 15:49:22 +02:00
Robert Krimen
81de6c8f02 Fix writable/enumerable/configurable of *.prototype to be false
Number, String, Array, RegExp, Error, etc.
2013-06-15 17:38:16 -07:00
Robert Krimen
a8c31cf457 Fix string/array/slice indexing to avoid uint32 => -int issue 2013-06-01 22:17:32 -07:00
Robert Krimen
4c85422172 Make encodeURI correspond to the 15.1.3.3 algorithm and encodeURIComponent ito 15.1.3.4 2013-05-02 20:23:06 +02:00
Robert Krimen
9184233705 Bundle terst dependency (github.com/robertkrimen/terst) 2013-04-15 10:20:34 -07:00
Robert Krimen
ad625cdddd Strip leading 0s from exponent 2013-02-22 13:43:43 -08:00
Robert Krimen
393b9384a5 Fit number (exponent/decimal) formatting to ECMA-262 (slightly better) 2013-02-22 11:50:04 -08:00
Robert Krimen
a24b29ebfe Fix toString(-0) 2013-02-21 19:02:29 -08:00
Robert Krimen
ec902a6452 Split builtin.go out to builtin_*.go 2013-02-20 15:58:45 -08:00
Robert Krimen
4e4e89c894 Fix bug in String.slice with a (go) slice bounds violation
Basically, check that start is less than length before trying
to take a slice.

Also, rename valueToArrayIndex to valueToRangeIndex to reflect
the fact that it does not always return a value that is valid
index (value could be length)
2013-02-20 15:58:43 -08:00
Robert Krimen
ae1fa3daef Fix indexOf to use safer _toInteger 2013-02-19 17:14:34 -08:00
Robert Krimen
809a0a0ba6 Split tests out of one big massive file 2013-02-05 08:56:08 -08:00