mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 17:01:08 +00:00

FreeCallback should be invoked on the storage disposal (`ArrayBuffer`), not when the view (`Uint8Array` or `Buffer`) is disposed. This causes bug and crashes in addons which create buffers and store only slices of them. PR-URL: https://github.com/nodejs/node/pull/3198 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
10 lines
207 B
JavaScript
10 lines
207 B
JavaScript
'use strict';
|
|
// Flags: --expose-gc
|
|
|
|
var assert = require('assert');
|
|
var binding = require('./build/Release/binding');
|
|
var buf = binding.alloc();
|
|
var slice = buf.slice(32);
|
|
buf = null;
|
|
binding.check(slice);
|