diff options
author | 2022-12-11 16:14:53 -0800 | |
---|---|---|
committer | 2022-12-11 16:14:53 -0800 | |
commit | 27e40b0836f183430e5ac7128d9046c561c07e73 (patch) | |
tree | a4dd9b600c0fb49f881169a5996a42085ee86993 /src | |
parent | b57f51fda2b8255ff986887c9b975db96277400a (diff) | |
download | bun-27e40b0836f183430e5ac7128d9046c561c07e73.tar.gz bun-27e40b0836f183430e5ac7128d9046c561c07e73.tar.zst bun-27e40b0836f183430e5ac7128d9046c561c07e73.zip |
Update WebKit
cc @cirospaciari you will need to re-download the precompiled WebKit build from the releases page https://github.com/oven-sh/WebKit/releases/tag/dec11 because there is one small WebKit API change. LMK if you have any trouble with that
Diffstat (limited to 'src')
m--------- | src/bun.js/WebKit | 0 | ||||
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 2 | ||||
-rw-r--r-- | src/bun.js/bindings/bindings.zig | 15 | ||||
-rw-r--r-- | src/bun.js/bindings/headers-cpp.h | 2 | ||||
-rw-r--r-- | src/bun.js/bindings/headers.h | 2 | ||||
-rw-r--r-- | src/bun.js/bindings/wtf-bindings.cpp | 8 | ||||
-rw-r--r-- | src/bun.zig | 4 | ||||
-rw-r--r-- | src/js_lexer.zig | 4 |
8 files changed, 31 insertions, 6 deletions
diff --git a/src/bun.js/WebKit b/src/bun.js/WebKit -Subproject 7e5db543dbeb0f5510c18b83b94c79ca391514f +Subproject 8f7ebd65df207e3da9df44e863ae0d982731429 diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index a1a11a1a0..29cf8b56e 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -207,7 +207,7 @@ extern "C" void JSCInitialize() JSC::Options::useShadowRealm() = true; JSC::Options::useResizableArrayBuffer() = true; JSC::Options::showPrivateScriptsInStackTraces() = true; - JSC::Options::ensureOptionsAreCoherent(); + JSC::Options::assertOptionsAreCoherent(); } } diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig index 0bd21ebac..559ae9184 100644 --- a/src/bun.js/bindings/bindings.zig +++ b/src/bun.js/bindings/bindings.zig @@ -3726,6 +3726,21 @@ pub fn untrackFunction( pub const WTF = struct { extern fn WTF__copyLCharsFromUCharSource(dest: [*]u8, source: *const anyopaque, len: usize) void; extern fn WTF__toBase64URLStringValue(bytes: [*]const u8, length: usize, globalObject: *JSGlobalObject) JSValue; + extern fn WTF__parseDouble(bytes: [*]const u8, length: usize, counted: *usize) f64; + + pub fn parseDouble(buf: []const u8) !f64 { + JSC.markBinding(@src()); + + if (buf.len == 0) + return error.InvalidCharacter; + + var count: usize = 0; + const res = WTF__parseDouble(buf.ptr, buf.len, &count); + + if (count == 0) + return error.InvalidCharacter; + return res; + } /// This uses SSE2 instructions and/or ARM NEON to copy 16-bit characters efficiently /// See wtf/Text/ASCIIFastPath.h for details diff --git a/src/bun.js/bindings/headers-cpp.h b/src/bun.js/bindings/headers-cpp.h index d5923902b..a4a5a5ced 100644 --- a/src/bun.js/bindings/headers-cpp.h +++ b/src/bun.js/bindings/headers-cpp.h @@ -1,4 +1,4 @@ -//-- AUTOGENERATED FILE -- 1670255504 +//-- AUTOGENERATED FILE -- 1670788310 // clang-format off #pragma once diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h index ec58a0a37..163438c69 100644 --- a/src/bun.js/bindings/headers.h +++ b/src/bun.js/bindings/headers.h @@ -1,5 +1,5 @@ // clang-format off -//-- AUTOGENERATED FILE -- 1670255504 +//-- AUTOGENERATED FILE -- 1670788310 #pragma once #include <stddef.h> diff --git a/src/bun.js/bindings/wtf-bindings.cpp b/src/bun.js/bindings/wtf-bindings.cpp index 699e3db5b..5c0e593d7 100644 --- a/src/bun.js/bindings/wtf-bindings.cpp +++ b/src/bun.js/bindings/wtf-bindings.cpp @@ -2,6 +2,12 @@ #include "wtf/text/Base64.h" #include "wtf/StackTrace.h" +#include "wtf/dtoa.h" + +extern "C" double WTF__parseDouble(const LChar* string, size_t length, size_t* position) +{ + return WTF::parseDouble(string, length, *position); +} extern "C" void WTF__copyLCharsFromUCharSource(LChar* destination, const UChar* source, size_t length) { @@ -27,7 +33,7 @@ extern "C" void Bun__crashReportDumpStackTrace(void* ctx) bool isFirst = true; for (int frameNumber = 0; frameNumber < size; ++frameNumber) { auto demangled = WTF::StackTraceSymbolResolver::demangle(stack[frameNumber]); - + StringPrintStream out; if (isFirst) { isFirst = false; diff --git a/src/bun.zig b/src/bun.zig index 1bdf7151f..d96d87ea0 100644 --- a/src/bun.zig +++ b/src/bun.zig @@ -545,3 +545,7 @@ pub fn StringHashMapUnmanaged(comptime Type: type) type { const CopyFile = @import("./copy_file.zig"); pub const copyFileRange = CopyFile.copyFileRange; pub const copyFile = CopyFile.copyFile; + +pub fn parseDouble(input: []const u8) !f64 { + return JSC.WTF.parseDouble(input); +} diff --git a/src/js_lexer.zig b/src/js_lexer.zig index 6ac8be968..e9ec7442b 100644 --- a/src/js_lexer.zig +++ b/src/js_lexer.zig @@ -2769,8 +2769,8 @@ fn NewLexer_( } lexer.number = @intToFloat(f64, number); } else { - // Parse a double-precision floating-point number; - if (std.fmt.parseFloat(f64, text)) |num| { + // Parse a double-precision floating-point number + if (bun.parseDouble(text)) |num| { lexer.number = num; } else |_| { try lexer.addSyntaxError(lexer.start, "Invalid number", .{}); |