All checks were successful
ci / fast (linux) (push) Successful in 6m35s
Implement primitive string property access (.length) and 18 String prototype methods (charAt, indexOf, slice, toUpperCase, trim, etc.), Function.name/.length properties and Function.prototype.call() for direct member-call syntax, and Object.prototype.toString.call() for type-tag formatting via a new setup_builtins() initializer. Changes NativeFn signature to receive Option<&JsValue> this parameter so native functions can access their receiver. Adds repeat() safety guard against Infinity/negative/OOM, fixes indexOf empty-string clamping and lastIndexOf optional from parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14 lines
521 B
JavaScript
14 lines
521 B
JavaScript
// String method tests: charAt, indexOf, includes, slice, toUpperCase, toLowerCase, trim
|
|
console.log("hello".charAt(0));
|
|
console.log("hello".charAt(4));
|
|
console.log("hello".charAt(99));
|
|
console.log("hello".indexOf("llo"));
|
|
console.log("hello".indexOf("xyz"));
|
|
console.log("hello world".includes("world"));
|
|
console.log("hello world".includes("xyz"));
|
|
console.log("hello".slice(1, 4));
|
|
console.log("hello".slice(-3));
|
|
console.log("HELLO".toLowerCase());
|
|
console.log("hello".toUpperCase());
|
|
console.log(" hello ".trim());
|