1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts] ////
//// [index.js]
// cjs format file
import {h} from "../index.js";
import mod = require("../index.js");
import {f as _f} from "./index.js";
import mod2 = require("./index.js");
export async function f() {
const mod3 = await import ("../index.js");
const mod4 = await import ("./index.js");
h();
}
//// [index.js]
// esm format file
import {h as _h} from "./index.js";
import mod = require("./index.js");
import {f} from "./subfolder/index.js";
import mod2 = require("./subfolder/index.js");
export async function h() {
const mod3 = await import ("./index.js");
const mod4 = await import ("./subfolder/index.js");
f();
}
//// [package.json]
{
"name": "package",
"private": true,
"type": "module"
}
//// [package.json]
{
"type": "commonjs"
}
//// [index.js]
import { createRequire as _createRequire } from "module";
const __require = _createRequire(import.meta.url);
// esm format file
import { h as _h } from "./index.js";
const mod = __require("./index.js");
import { f } from "./subfolder/index.js";
const mod2 = __require("./subfolder/index.js");
export async function h() {
const mod3 = await import("./index.js");
const mod4 = await import("./subfolder/index.js");
f();
}
//// [index.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.f = void 0;
// cjs format file
const index_js_1 = require("../index.js");
const mod = require("../index.js");
const index_js_2 = require("./index.js");
const mod2 = require("./index.js");
async function f() {
const mod3 = await import("../index.js");
const mod4 = await import("./index.js");
(0, index_js_1.h)();
}
exports.f = f;
//// [index.d.ts]
export function h(): Promise<void>;
//// [index.d.ts]
export function f(): Promise<void>;
|