File: nodeModulesAllowJsSynchronousCallErrors%28module%3Dnode16%29.js

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (69 lines) | stat: -rw-r--r-- 1,919 bytes parent folder | download | duplicates (2)
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>;