diff options
author | 2023-04-05 03:31:58 -0400 | |
---|---|---|
committer | 2023-04-05 00:31:58 -0700 | |
commit | fd5bb6b201451e757fbe4a96bfb4032b9413a434 (patch) | |
tree | a86658c1f44e65faa54a7f960516d0b0b2d72426 /src/bun.js | |
parent | d8360ab3cfd080b1a3ad72fa4ff623d8c4cf9fe7 (diff) | |
download | bun-fd5bb6b201451e757fbe4a96bfb4032b9413a434.tar.gz bun-fd5bb6b201451e757fbe4a96bfb4032b9413a434.tar.zst bun-fd5bb6b201451e757fbe4a96bfb4032b9413a434.zip |
fix: modules to have null prototype (#2561)
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/path.exports.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bun.js/path.exports.js b/src/bun.js/path.exports.js index 41d437bd0..8879771ab 100644 --- a/src/bun.js/path.exports.js +++ b/src/bun.js/path.exports.js @@ -1,5 +1,8 @@ +// Utils to extract later +const createModule = (obj) => Object.assign(Object.create(null), obj); + function bound(obj) { - var result = { + var result = createModule({ basename: obj.basename.bind(obj), dirname: obj.dirname.bind(obj), extname: obj.extname.bind(obj), @@ -13,7 +16,7 @@ function bound(obj) { toNamespacedPath: obj.toNamespacedPath.bind(obj), sep: obj.sep, delimiter: obj.delimiter, - }; + }); result.default = result; return result; } |