Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update shim files to use window instead of global #286

Merged
merged 1 commit into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function(grunt) {
},
jshint: {
options: {
jshintrc: '.jshintrc'
jshintrc: true
},
files: [
'./Gruntfile.js',
Expand Down
24 changes: 24 additions & 0 deletions src/util/shim/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"globals": {
"Blob": true,
"FileReader": true
},
"browser": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": false,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": false,
"eqnull": false,
"node": true,
"devel": true,
"strict": false,
"trailing": true,
"quotmark": "single",
"proto": true,
"laxbreak": true
}
2 changes: 1 addition & 1 deletion src/util/shim/WebSocket.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = global.WebSocket;
module.exports = window.WebSocket;
4 changes: 2 additions & 2 deletions src/util/shim/decompressPng.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

var Canvas = require('canvas');
var Image = Canvas.Image || global.Image;
var Image = Canvas.Image || window.Image;

/**
* If a message was compressed as a PNG image (a compression hack since
Expand Down Expand Up @@ -53,4 +53,4 @@ function decompressPng(data, callback) {
image.src = 'data:image/png;base64,' + data;
}

module.exports = decompressPng;
module.exports = decompressPng;
6 changes: 3 additions & 3 deletions src/util/shim/xmldom.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
exports.DOMImplementation = global.DOMImplementation;
exports.XMLSerializer = global.XMLSerializer;
exports.DOMParser = global.DOMParser;
exports.DOMImplementation = window.DOMImplementation;
exports.XMLSerializer = window.XMLSerializer;
exports.DOMParser = window.DOMParser;