(arg)
| 5046 | const tamedMethods= { |
| 5047 | // See https://tc39.es/ecma262/#sec-string.prototype.localecompare |
| 5048 | localeCompare(arg) { |
| 5049 | if( this=== null|| this=== undefined) { |
| 5050 | throw TypeError( |
| 5051 | 'Cannot localeCompare with null or undefined "this" value'); |
| 5052 | |
| 5053 | } |
| 5054 | const s= `${this}`; |
| 5055 | const that= `${arg}`; |
| 5056 | if( s< that) { |
| 5057 | return -1; |
| 5058 | } |
| 5059 | if( s> that) { |
| 5060 | return 1; |
| 5061 | } |
| 5062 | s=== that|| Fail `expected ${q(s)} and ${q(that)} to compare`; |
| 5063 | return 0; |
| 5064 | }, |
| 5065 | |
| 5066 | toString() { |
| 5067 | return `${this}`; |