mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-06 02:24:47 -04:00
Merge pull request #2936 from adroitwhiz/remove-new-buffer
Replace `new Buffer()` with `Buffer.from()`
This commit is contained in:
commit
2d6cce5f7f
2 changed files with 2 additions and 2 deletions
test
2
test/fixtures/readProjectFile.js
vendored
2
test/fixtures/readProjectFile.js
vendored
|
@ -3,7 +3,7 @@ const fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
readFileToBuffer: function (path) {
|
readFileToBuffer: function (path) {
|
||||||
return new Buffer(fs.readFileSync(path));
|
return Buffer.from(fs.readFileSync(path));
|
||||||
},
|
},
|
||||||
extractProjectJson: function (path) {
|
extractProjectJson: function (path) {
|
||||||
const zip = new AdmZip(path);
|
const zip = new AdmZip(path);
|
||||||
|
|
|
@ -13,7 +13,7 @@ const VirtualMachine = require('../../src/index');
|
||||||
|
|
||||||
const projectUri = path.resolve(__dirname, '../fixtures/offline-custom-assets.sb2');
|
const projectUri = path.resolve(__dirname, '../fixtures/offline-custom-assets.sb2');
|
||||||
const projectZip = AdmZip(projectUri);
|
const projectZip = AdmZip(projectUri);
|
||||||
const project = new Buffer(fs.readFileSync(projectUri));
|
const project = Buffer.from(fs.readFileSync(projectUri));
|
||||||
// Custom costume from sb2 file (which was downloaded from offline editor)
|
// Custom costume from sb2 file (which was downloaded from offline editor)
|
||||||
// This sound should not be available on our servers
|
// This sound should not be available on our servers
|
||||||
const costume = projectZip.readFile('1.svg');
|
const costume = projectZip.readFile('1.svg');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue