aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/module_loader.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/module_loader.zig')
-rw-r--r--src/bun.js/module_loader.zig29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/bun.js/module_loader.zig b/src/bun.js/module_loader.zig
index 8b557377b..c2c49c423 100644
--- a/src/bun.js/module_loader.zig
+++ b/src/bun.js/module_loader.zig
@@ -2027,32 +2027,9 @@ pub const ModuleLoader = struct {
.source_code = ZigString.init(
\\const symbol = Symbol.for("CommonJS");
\\const lazy = globalThis[Symbol.for("Bun.lazy")];
- \\// creating this triggers a watchpoint in JSC, so lets delay doing that.
- \\var masqueradesAsUndefined, hasMasqueradedAsUndefined;
- \\const target = {[symbol]: 0};
- \\const proxy = new Proxy(target, {
- \\ get: function (target, prop) {
- \\ if (prop in target) {
- \\ return target[prop];
- \\ }
- \\
- \\ if (!hasMasqueradedAsUndefined) {
- \\ masqueradesAsUndefined = lazy("masqueradesAsUndefined");
- \\ hasMasqueradedAsUndefined = true;
- \\ }
- \\
- \\ return masqueradesAsUndefined;
- \\ },
- \\ set: function (target, prop, value) {
- \\ target[prop] = value;
- \\ return true;
- \\ },
- \\ has: function (target, prop) {
- \\ return prop in target;
- \\ },
- \\});
- \\
- \\export default proxy;
+ \\var masqueradesAsUndefined = lazy("masqueradesAsUndefined");
+ \\masqueradesAsUndefined[symbol] = 0;
+ \\export default masqueradesAsUndefined;
\\
),
.specifier = ZigString.init(specifier),