mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
misc cleanup
This commit is contained in:
20
Makefile
20
Makefile
@@ -405,6 +405,13 @@ jsc-check:
|
||||
|
||||
all-js: runtime_js fallback_decoder bun_error node-fallbacks
|
||||
|
||||
fmt-cpp:
|
||||
cd src/javascript/jsc/bindings && clang-format *.cpp *.h -i
|
||||
|
||||
fmt-zig:
|
||||
cd src && zig fmt **/*.zig
|
||||
|
||||
fmt: fmt-cpp fmt-zig
|
||||
|
||||
api:
|
||||
$(NPM_CLIENT) install
|
||||
@@ -471,11 +478,16 @@ bun-codesign-release-local:
|
||||
codesign --entitlements $(realpath entitlements.plist) --options runtime --force --timestamp --sign "$(CODESIGN_IDENTITY)" -vvvv --deep --strict $(RELEASE_BUN)
|
||||
codesign --entitlements $(realpath entitlements.plist) --options runtime --force --timestamp --sign "$(CODESIGN_IDENTITY)" -vvvv --deep --strict $(PACKAGE_DIR)/bun-profile
|
||||
|
||||
bun-codesign-release-local-debug:
|
||||
codesign --entitlements $(realpath entitlements.debug.plist) --options runtime --force --timestamp --sign "$(CODESIGN_IDENTITY)" -vvvv --deep --strict $(RELEASE_BUN)
|
||||
codesign --entitlements $(realpath entitlements.debug.plist) --options runtime --force --timestamp --sign "$(CODESIGN_IDENTITY)" -vvvv --deep --strict $(PACKAGE_DIR)/bun-profile
|
||||
|
||||
|
||||
endif
|
||||
|
||||
bun-codesign-debug:
|
||||
bun-codesign-release-local:
|
||||
bun-codesign-release-local-debug:
|
||||
|
||||
|
||||
jsc: jsc-build jsc-copy-headers jsc-bindings
|
||||
@@ -716,19 +728,17 @@ jsc-build-mac-compile:
|
||||
mkdir -p $(WEBKIT_RELEASE_DIR) $(WEBKIT_DIR);
|
||||
cd $(WEBKIT_RELEASE_DIR) && \
|
||||
ICU_INCLUDE_DIRS="$(HOMEBREW_PREFIX)opt/icu4c/include" \
|
||||
CMAKE_BUILD_TYPE=Release cmake \
|
||||
CMAKE_BUILD_TYPE=RelWithDebugInfo cmake \
|
||||
-DPORT="JSCOnly" \
|
||||
-DENABLE_STATIC_JSC=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
|
||||
-DUSE_THIN_ARCHIVES=OFF \
|
||||
-DENABLE_FTL_JIT=ON \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
$(CMAKE_FLAGS_WITHOUT_RELEASE) \
|
||||
-DPTHREAD_JIT_PERMISSIONS_API=1 \
|
||||
-DUSE_PTHREAD_JIT_PERMISSIONS_API=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
$(WEBKIT_DIR) \
|
||||
$(WEBKIT_RELEASE_DIR) && \
|
||||
CFLAGS="$CFLAGS -ffat-lto-objects" CXXFLAGS="$CXXFLAGS -ffat-lto-objects" \
|
||||
@@ -814,7 +824,7 @@ bun-link-lld-release:
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
bun-link-lld-release-dsym:
|
||||
$(DSYMUTIL) -o $(BUN_RELEASE_BIN).dSYM $(BUN_RELEASE_BIN)
|
||||
-$(STRIP) $(BUN_RELEASE_BIN)
|
||||
# -$(STRIP) $(BUN_RELEASE_BIN)
|
||||
mv $(BUN_RELEASE_BIN).o /tmp/bun-$(PACKAGE_JSON_VERSION).o
|
||||
|
||||
copy-to-bun-release-dir-dsym:
|
||||
|
||||
@@ -282,7 +282,7 @@ pub fn NewPrinter(
|
||||
|
||||
var remaining: usize = n;
|
||||
while (remaining > 0) {
|
||||
const to_write = std.math.min(remaining, bytes.len);
|
||||
const to_write = @minimum(remaining, bytes.len);
|
||||
try self.writeAll(bytes[0..to_write]);
|
||||
remaining -= to_write;
|
||||
}
|
||||
@@ -931,7 +931,6 @@ pub fn NewPrinter(
|
||||
|
||||
if (c2 >= first_high_surrogate and c2 <= last_low_surrogate) {
|
||||
i += 1;
|
||||
const r: CodeUnitType = 0x10000 + (((c & 0x03ff) << 10) | (c2 & 0x03ff));
|
||||
|
||||
// Escape this character if UTF-8 isn't allowed
|
||||
if (ascii_only) {
|
||||
@@ -946,6 +945,8 @@ pub fn NewPrinter(
|
||||
// Otherwise, encode to UTF-8
|
||||
}
|
||||
|
||||
const r: CodeUnitType = 0x10000 + (((c & 0x03ff) << 10) | (c2 & 0x03ff));
|
||||
|
||||
var ptr = e.writer.reserve(4) catch unreachable;
|
||||
e.writer.advance(strings.encodeWTF8RuneT(ptr[0..4], CodeUnitType, r));
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user