CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-setprototypeof

A small polyfill for Object.setPrototypeOf with cross-platform compatibility

82

1.02x
Overview
Eval results
Files

rubric.jsonevals/scenario-1/

{
  "context": "Evaluates how the solution leverages the setprototypeof package to rebind object prototypes as described in the spec. Checks correct use of the library for normal and null prototypes and validation before mutation.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Imports package",
      "description": "Requires/imports the setprototypeof package and calls its exported function (commonly named setPrototypeOf) as the mechanism for prototype changes instead of manual __proto__ assignment or Object.setPrototypeOf direct calls.",
      "max_score": 35
    },
    {
      "name": "Rebinds prototype",
      "description": "Uses setprototypeof to set the provided prototype on the target object so Object.getPrototypeOf(target) equals the new prototype and returns the same object reference after rebinding.",
      "max_score": 25
    },
    {
      "name": "Null prototype support",
      "description": "Invokes setprototypeof with a null prototype and preserves existing own properties while ensuring the resulting object has a null prototype as required.",
      "max_score": 20
    },
    {
      "name": "Prototype validation",
      "description": "Performs an explicit type check before calling setprototypeof so non-object, non-null prototypes (e.g., numbers) trigger a TypeError without mutating the target.",
      "max_score": 20
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-setprototypeof

tile.json