aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/path-win32.exports.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-02 23:33:37 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-02 23:33:37 -0800
commita52a948a706724895979604e780a6a5d5db92f95 (patch)
treec72e88af48b3cb78f542f1ed9ccb412e72cc9a04 /src/javascript/jsc/path-win32.exports.js
parent94cbfa45792342105fb1a5b69cafc3a8f4a1ba7a (diff)
downloadbun-a52a948a706724895979604e780a6a5d5db92f95.tar.gz
bun-a52a948a706724895979604e780a6a5d5db92f95.tar.zst
bun-a52a948a706724895979604e780a6a5d5db92f95.zip
`path.relative` passes Node's tests (which also fixed bugs)
Diffstat (limited to 'src/javascript/jsc/path-win32.exports.js')
-rw-r--r--src/javascript/jsc/path-win32.exports.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/javascript/jsc/path-win32.exports.js b/src/javascript/jsc/path-win32.exports.js
new file mode 100644
index 000000000..932cc8960
--- /dev/null
+++ b/src/javascript/jsc/path-win32.exports.js
@@ -0,0 +1,35 @@
+function bound(obj) {
+ return {
+ basename: obj.basename.bind(obj),
+ dirname: obj.dirname.bind(obj),
+ extname: obj.extname.bind(obj),
+ format: obj.format.bind(obj),
+ isAbsolute: obj.isAbsolute.bind(obj),
+ join: obj.join.bind(obj),
+ normalize: obj.normalize.bind(obj),
+ parse: obj.parse.bind(obj),
+ relative: obj.relative.bind(obj),
+ resolve: obj.resolve.bind(obj),
+ toNamespacedPath: obj.toNamespacedPath.bind(obj),
+ sep: obj.sep,
+ delimiter: obj.delimiter,
+ };
+}
+var path = bound(Bun._Path(true));
+
+export var {
+ basename,
+ dirname,
+ extname,
+ format,
+ isAbsolute,
+ join,
+ normalize,
+ parse,
+ relative,
+ resolve,
+ toNamespacedPath,
+ sep,
+ delimiter,
+} = path;
+export default path;