Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/modules/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  import-meta.js   Sprache: JAVA

 
// |jit-test| module

// import.meta is an object.
assertEq(typeof import.meta, "object");
assertEq(import.meta !== nulltrue);

// import.meta always returns the same object.
let obj = import.meta;
assertEq(import.meta, obj);

// Test calling from lazily compile function.
function get() {
    return import.meta;
}
assertEq(get(), import.meta);

// import.meta.url: This property will contain the module script's base URL,
// serialized.

assertEq("url" in import.meta, true);
assertEq(import.meta.url.endsWith("import-meta.js"), true);

assertEq("resolve" in import.meta, true);

assertEq(import.meta.resolve("./x"),
         import.meta.url.replace("import-meta.js""x"));

import getOtherMetaObject from "exportImportMeta.js";

let otherImportMeta = getOtherMetaObject();
assertEq(otherImportMeta.url.endsWith("exportImportMeta.js"), true);

// By default the import.meta object will be extensible, and its properties will
// be writable, configurable, and enumerable.

assertEq(Object.isExtensible(import.meta), true);

for (const name of Reflect.ownKeys(import.meta)) {
  const desc = Object.getOwnPropertyDescriptor(import.meta, name);
  assertEq(desc.writable, true);
  assertEq(desc.enumerable, true);
  assertEq(desc.configurable, true);
  assertEq(desc.value, import.meta[name]);
}

// The import.meta object's prototype is null.
assertEq(Object.getPrototypeOf(import.meta), null);

import.meta.url = 0;
assertEq(import.meta.url, 0);

import.meta.newProp = 42;
assertEq(import.meta.newProp, 42);

let found = new Set(Reflect.ownKeys(import.meta));

assertEq(found.size, 3);
assertEq(found.has("url"), true);
assertEq(found.has("newProp"), true);
assertEq(found.has("resolve"), true);

delete import.meta.url;
delete import.meta.newProp;
delete import.meta.resolve;

found = new Set(Reflect.ownKeys(import.meta));
assertEq(found.size, 0);

Messung V0.5
C=87 H=97 G=91

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.