mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
polyfills: fix unsafe.arrayBufferToString
This commit is contained in:
@@ -16,7 +16,7 @@ if (typeof process === 'object' && process !== null) {
|
||||
process.versions.c_ares = '0e7a5dee0fbb04080750cf6eabbe89d8bae87faa' satisfies Process['versions'][string];
|
||||
process.versions.zig = '0.12.0-dev.1604+caae40c21' satisfies Process['versions'][string];
|
||||
process.versions.bun = '1.0.13' satisfies Process['versions'][string];
|
||||
Reflect.set(process, 'revision', '93b32aef29467a842d57008688b2f66ddde70a0b' satisfies Process['revision']);
|
||||
Reflect.set(process, 'revision', 'b63fc096bf5bcab16a8a8624fda6a7c79002e428' satisfies Process['revision']);
|
||||
/** @end_generated_code */
|
||||
|
||||
// Doesn't work on Windows sadly
|
||||
|
||||
@@ -48,7 +48,7 @@ export const main = path.resolve(process.cwd(), process.argv[1] ?? 'repl') satis
|
||||
|
||||
//? These are automatically updated on build by tools/updateversions.ts, do not edit manually.
|
||||
export const version = '1.0.13' satisfies typeof Bun.version;
|
||||
export const revision = '93b32aef29467a842d57008688b2f66ddde70a0b' satisfies typeof Bun.revision;
|
||||
export const revision = 'b63fc096bf5bcab16a8a8624fda6a7c79002e428' satisfies typeof Bun.revision;
|
||||
|
||||
export const gc = (
|
||||
globalThis.gc
|
||||
@@ -78,8 +78,10 @@ Object.setPrototypeOf(hash, bunHashProto satisfies Hash);
|
||||
|
||||
export const unsafe = {
|
||||
gcAggressionLevel: () => 0, //! no-op
|
||||
arrayBufferToString: (buf) => new TextDecoder().decode(buf),
|
||||
segfault: () => {
|
||||
arrayBufferToString(buf) {
|
||||
return new TextDecoder(buf instanceof Uint16Array ? 'utf-16' : 'utf-8').decode(buf);
|
||||
},
|
||||
segfault() {
|
||||
const segfault = new Error();
|
||||
segfault.name = 'SegfaultTest';
|
||||
segfault.message = '';
|
||||
|
||||
@@ -38,6 +38,7 @@ await import('../../../test/js/bun/util/mmap.test.js');
|
||||
await import('../../../test/js/bun/util/peek.test.ts');
|
||||
await import('../../../test/js/bun/util/readablestreamtoarraybuffer.test.ts');
|
||||
await import('../../../test/js/bun/util/sleepSync.test.ts');
|
||||
await import('../../../test/js/bun/util/unsafe.test.js');
|
||||
// websocket
|
||||
// globals
|
||||
|
||||
|
||||
Reference in New Issue
Block a user