MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / localeCompare

Function localeCompare

ses.cjs:5048–5064  ·  view source on GitHub ↗
(arg)

Source from the content-addressed store, hash-verified

5046const 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}`;

Callers

nothing calls this directly

Calls 1

FailFunction · 0.85

Tested by

no test coverage detected