]> zoso.dev Git - buffer.git/commitdiff
move common.js to node/ folder so it doesn't run in ES5 browsers
authorFeross Aboukhadijeh <feross@feross.org>
Fri, 16 Feb 2018 05:27:49 +0000 (21:27 -0800)
committerFeross Aboukhadijeh <feross@feross.org>
Fri, 16 Feb 2018 05:27:49 +0000 (21:27 -0800)
bin/download-node-tests.js
test/node/common.js [moved from test/common.js with 100% similarity]
test/node/test-buffer-alloc.js
test/node/test-buffer-arraybuffer.js
test/node/test-buffer-fill.js

index 464bb47b23b50354fa4a546ab9bfb294cefff707..0be09cb9db8bde851a3a9e9b730d2bd58bf7d68d 100755 (executable)
@@ -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')
 
similarity index 100%
rename from test/common.js
rename to test/node/common.js
index aa6dc48f0ec0387554bac2bc43b30cd498d0d6f9..03cc26d072b316be6208ad9ef255f75d4f494fa8 100644 (file)
@@ -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');
 
index 4e3b31adece8ddfb9723475f7ea48575e582cc70..d264e7f16d63e111c8f33bef39b7de2ec62fa75b 100644 (file)
@@ -1,6 +1,6 @@
 'use strict';
 var Buffer = require('../../').Buffer;
-var common = require('../common');
+var common = require('./common');
 
 
 var assert = require('assert');
index eb88b8363af9dfd790559d2102c007d4458ebb5b..56d479c28f4e8b5ab4d199ecbf3390125320569a 100644 (file)
@@ -1,6 +1,6 @@
 'use strict';
 var Buffer = require('../../').Buffer;
-const common = require('../common');
+const common = require('./common');
 
 
 var assert = require('assert');