aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/bindings/ZigSourceProvider.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/bun.js/bindings/ZigSourceProvider.cpp b/src/bun.js/bindings/ZigSourceProvider.cpp
index c2959a8fa..3a313a0c1 100644
--- a/src/bun.js/bindings/ZigSourceProvider.cpp
+++ b/src/bun.js/bindings/ZigSourceProvider.cpp
@@ -27,24 +27,20 @@ using SourceOrigin = JSC::SourceOrigin;
using String = WTF::String;
using SourceProviderSourceType = JSC::SourceProviderSourceType;
-static char* wasmSourceName = "[WebAssembly Source]";
-static size_t wasmSourceName_len = 20;
-
Ref<SourceProvider> SourceProvider::create(ResolvedSource resolvedSource)
{
void* allocator = resolvedSource.allocator;
JSC::SourceProviderSourceType sourceType = JSC::SourceProviderSourceType::Module;
- // JSC owns the memory
- if (resolvedSource.hash == 1) {
- Ref<WTF::StringImpl> stringImpl_ = WTF::StringImpl::create(resolvedSource.source_code.ptr, resolvedSource.source_code.len);
- return adoptRef(*new SourceProvider(
- resolvedSource, WTFMove(stringImpl_),
- JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(toString(resolvedSource.source_url))),
- toStringNotConst(resolvedSource.source_url), TextPosition(),
- sourceType));
- }
+ // // JSC owns the memory
+ // if (resolvedSource.hash == 1) {
+ // return adoptRef(*new SourceProvider(
+ // resolvedSource, WTF::StringImpl::create(resolvedSource.source_code.ptr, resolvedSource.source_code.len),
+ // JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(toString(resolvedSource.source_url))),
+ // toStringNotConst(resolvedSource.source_url).isolatedCopy(), TextPosition(),
+ // sourceType));
+ // }
if (allocator) {
Ref<WTF::ExternalStringImpl> stringImpl_ = WTF::ExternalStringImpl::create(
@@ -52,7 +48,7 @@ Ref<SourceProvider> SourceProvider::create(ResolvedSource resolvedSource)
allocator,
RefString__free);
return adoptRef(*new SourceProvider(
- resolvedSource, WTFMove(stringImpl_),
+ resolvedSource, stringImpl_,
JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(toString(resolvedSource.source_url))),
toStringNotConst(resolvedSource.source_url), TextPosition(),
sourceType));
@@ -60,7 +56,7 @@ Ref<SourceProvider> SourceProvider::create(ResolvedSource resolvedSource)
Ref<WTF::ExternalStringImpl> stringImpl_ = WTF::ExternalStringImpl::createStatic(
resolvedSource.source_code.ptr, resolvedSource.source_code.len);
return adoptRef(*new SourceProvider(
- resolvedSource, WTFMove(stringImpl_),
+ resolvedSource, stringImpl_,
JSC::SourceOrigin(WTF::URL::fileURLWithFileSystemPath(toString(resolvedSource.source_url))),
toStringNotConst(resolvedSource.source_url), TextPosition(),
sourceType));