mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix: Buffer global in --unstable-node-globals (#26973)
This commit is contained in:
parent
3f3568bd95
commit
aa0ba6580e
3 changed files with 9 additions and 3 deletions
|
@ -32,7 +32,7 @@ import { DOMException } from "ext:deno_web/01_dom_exception.js";
|
||||||
import * as abortSignal from "ext:deno_web/03_abort_signal.js";
|
import * as abortSignal from "ext:deno_web/03_abort_signal.js";
|
||||||
import * as imageData from "ext:deno_web/16_image_data.js";
|
import * as imageData from "ext:deno_web/16_image_data.js";
|
||||||
import process from "node:process";
|
import process from "node:process";
|
||||||
import Buffer from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
import { clearImmediate, setImmediate } from "node:timers";
|
import { clearImmediate, setImmediate } from "node:timers";
|
||||||
import { loadWebGPU } from "ext:deno_webgpu/00_init.js";
|
import { loadWebGPU } from "ext:deno_webgpu/00_init.js";
|
||||||
import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";
|
import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
global: true
|
global: true
|
||||||
Buffer: true
|
Buffer: function from(
|
||||||
|
value,
|
||||||
|
encodingOrOffset,
|
||||||
|
length,
|
||||||
|
) {
|
||||||
|
return _from(value, encodingOrOffset, length);
|
||||||
|
}
|
||||||
setImmediate: true
|
setImmediate: true
|
||||||
clearImmediate: true
|
clearImmediate: true
|
||||||
|
|
|
@ -2,6 +2,6 @@ import * as nodeBuffer from "node:buffer";
|
||||||
import * as nodeTimers from "node:timers";
|
import * as nodeTimers from "node:timers";
|
||||||
|
|
||||||
console.log(`global: ${globalThis === global}`);
|
console.log(`global: ${globalThis === global}`);
|
||||||
console.log(`Buffer: ${Buffer === nodeBuffer.default}`);
|
console.log(`Buffer: ${Buffer.from}`);
|
||||||
console.log(`setImmediate: ${setImmediate === nodeTimers.setImmediate}`);
|
console.log(`setImmediate: ${setImmediate === nodeTimers.setImmediate}`);
|
||||||
console.log(`clearImmediate: ${clearImmediate === nodeTimers.clearImmediate}`);
|
console.log(`clearImmediate: ${clearImmediate === nodeTimers.clearImmediate}`);
|
||||||
|
|
Loading…
Reference in a new issue