Skip to content

Commit eeafa44

Browse files
[fix] Remove any reference to the global variable
Related: #1166
1 parent dfc34e4 commit eeafa44

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"parser": "babel-eslint",
44
"env": {
55
// Note: mocha env is defined inside test/.eslintrc.json
6-
"node": true
6+
"node": true,
7+
"browser": true
78
},
89
"rules": {
910
"yoda": 0,

lib/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function url (uri, loc) {
2525
var obj = uri;
2626

2727
// default to window.location
28-
loc = loc || global.location;
28+
loc = loc || (typeof location !== 'undefined' && location);
2929
if (null == uri) uri = loc.protocol + '//' + loc.host;
3030

3131
// relative path support

support/webpack.config.dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ module.exports = {
1010
externals: {
1111
global: glob()
1212
},
13+
node: {
14+
Buffer: false
15+
},
1316
devtool: 'source-map',
1417
module: {
1518
loaders: [{
1619
test: /\.js$/,
1720
exclude: /(node_modules|bower_components)/,
1821
loader: 'babel-loader',
1922
query: { presets: ['es2015'] }
20-
}, {
21-
test: /\json3.js/,
22-
loader: 'imports?define=>false'
2323
}]
2424
}
2525
};

support/webpack.config.slim.dev.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ module.exports = {
1010
filename: 'socket.io.slim.dev.js'
1111
},
1212
externals: {
13-
global: glob(),
14-
json3: 'JSON'
13+
global: glob()
14+
},
15+
node: {
16+
Buffer: false
1517
},
1618
devtool: 'source-map',
1719
plugins: [
@@ -23,9 +25,6 @@ module.exports = {
2325
exclude: /(node_modules|bower_components)/,
2426
loader: 'babel-loader',
2527
query: { presets: ['es2015'] }
26-
}, {
27-
test: /\json3.js/,
28-
loader: 'imports?define=>false'
2928
}, {
3029
test: /\.js$/,
3130
loader: 'strip-loader?strip[]=debug'

0 commit comments

Comments
 (0)