All checks were successful
ci / fast (linux) (push) Successful in 6m43s
Implement user-facing Object enumeration and prototype methods that were missing from the JS engine: for...in inherited property enumeration, Object.keys/values/entries/create/getPrototypeOf/assign static methods, hasOwnProperty/propertyIsEnumerable instance methods, and non-enumerable property support to prevent builtin methods from leaking into enumeration. Key changes: - Add non_enumerable_keys HashSet to JsObjectData with mark/query methods - Fix for...in to walk prototype chain (all_enumerable_keys) - Mark all builtin prototype methods non-enumerable (Object, Number, String, Boolean, Error, class prototypes) - Add Object.prototype fallback for Function dispatch - 26 new unit tests, 8 new JS262 conformance tests - Test262 pass rate: 385/550 (70%, up from 47.8%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 lines
351 B
JavaScript
15 lines
351 B
JavaScript
function Animal(name) { this.name = name; }
|
|
Animal.prototype.legs = 4;
|
|
var a = new Animal("cat");
|
|
var found_name = false;
|
|
var found_legs = false;
|
|
var count = 0;
|
|
for (var k in a) {
|
|
if (k === "name") found_name = true;
|
|
if (k === "legs") found_legs = true;
|
|
count = count + 1;
|
|
}
|
|
console.log(found_name);
|
|
console.log(found_legs);
|
|
console.log(count);
|