From: Feross Aboukhadijeh Date: Fri, 16 Feb 2018 05:27:49 +0000 (-0800) Subject: move common.js to node/ folder so it doesn't run in ES5 browsers X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=735da3d97f55d2d5bf6bce16218c7cde36a81a0b;p=buffer.git move common.js to node/ folder so it doesn't run in ES5 browsers --- diff --git a/bin/download-node-tests.js b/bin/download-node-tests.js index 464bb47..0be09cb 100755 --- a/bin/download-node-tests.js +++ b/bin/download-node-tests.js @@ -71,6 +71,9 @@ function testfixer (filename) { firstline = false } + // make `require('../common')` work + line = line.replace(/require\('\.\.\/common'\);/g, 'require(\'./common\')') + // require browser buffer line = line.replace(/(.*)require\('buffer'\)(.*)/g, '$1require(\'../../\')$2') diff --git a/test/common.js b/test/node/common.js similarity index 100% rename from test/common.js rename to test/node/common.js diff --git a/test/node/test-buffer-alloc.js b/test/node/test-buffer-alloc.js index aa6dc48..03cc26d 100644 --- a/test/node/test-buffer-alloc.js +++ b/test/node/test-buffer-alloc.js @@ -1,6 +1,6 @@ 'use strict'; var Buffer = require('../../').Buffer; -const common = require('../common'); +const common = require('./common'); const assert = require('assert'); const vm = require('vm'); diff --git a/test/node/test-buffer-arraybuffer.js b/test/node/test-buffer-arraybuffer.js index 4e3b31a..d264e7f 100644 --- a/test/node/test-buffer-arraybuffer.js +++ b/test/node/test-buffer-arraybuffer.js @@ -1,6 +1,6 @@ 'use strict'; var Buffer = require('../../').Buffer; -var common = require('../common'); +var common = require('./common'); var assert = require('assert'); diff --git a/test/node/test-buffer-fill.js b/test/node/test-buffer-fill.js index eb88b83..56d479c 100644 --- a/test/node/test-buffer-fill.js +++ b/test/node/test-buffer-fill.js @@ -1,6 +1,6 @@ 'use strict'; var Buffer = require('../../').Buffer; -const common = require('../common'); +const common = require('./common'); var assert = require('assert');