mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
15 lines
443 B
JavaScript
15 lines
443 B
JavaScript
// A require whose binding IS reachable from code above it: Node would
|
|
// throw "Cannot access 'greet' before initialization" at the helper()
|
|
// call (the const initializes AT the require), an ordering the compiled
|
|
// aliasing does not model — the require keeps a named SC1013 fence.
|
|
'use strict';
|
|
|
|
console.log('boot', helper());
|
|
const { greet } = require('./lib.js');
|
|
|
|
function helper() {
|
|
return greet('early');
|
|
}
|
|
|
|
console.log(helper());
|