1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-29 02:29:06 -05:00
denoland-deno/tests/testdata/npm/cjs_this_in_exports/main.js

12 lines
449 B
JavaScript
Raw Normal View History

import defaultImport, { getValue } from "npm:@denotest/cjs-this-in-exports";
import * as namespaceImport from "npm:@denotest/cjs-this-in-exports";
console.log(defaultImport.getValue());
// In Node this actually fails, but it seems to work in Deno
// so I guess there's no harm in that.
console.log(namespaceImport.getValue());
// This will throw because it's lost its context.
// (same thing occurs with Node's cjs -> esm translation)
getValue();