namespace-order.mjs 603 B

12345678910111213141516
  1. import * as ns from "./default-and-star-export.mjs";
  2. const keys = Reflect.ownKeys(ns);
  3. // The keys should be in alphabetical order and @@toString at the end
  4. if (keys.length < 4) throw new Error("Expected at least 3 keys and @@toStringTag");
  5. if (keys[0] !== "") throw new Error('Expected keys[0] === ""');
  6. if (keys[1] !== "*") throw new Error('Expected keys[1] === "*"');
  7. if (keys[2] !== "default") throw new Error('Expected keys[2] === "default"');
  8. if (keys.indexOf(Symbol.toStringTag) <= 2)
  9. throw new Error("Expected Symbol.toStringTag to be behind string keys");
  10. export const passed = true;