diff --git a/src/dom/node.js b/src/dom/node.js index 21565f5b..59eacf53 100644 --- a/src/dom/node.js +++ b/src/dom/node.js @@ -13,6 +13,7 @@ // Node.js emulation layer of browser based environment, based on node-canvas // and jsdom. +/*global document:true, window:true, navigator:true, HTMLCanvasElement:true, Image:true */ var jsdom = require('jsdom'), // Node Canvas library: https://github.com/learnboost/node-canvas Canvas = require('canvas'), diff --git a/src/net/Http.js b/src/net/Http.js index 21d6cc54..dddae221 100644 --- a/src/net/Http.js +++ b/src/net/Http.js @@ -14,8 +14,8 @@ var Http = { request: function(method, url, callback, async) { // Code borrowed from Coffee Script and extended: async = (async === undefined) ? true : async; - var xhr = new (window.ActiveXObject || XMLHttpRequest)( - 'Microsoft.XMLHTTP'); + var xhrConstructor = window.ActiveXObject || XMLHttpRequest; + var xhr = new xhrConstructor('Microsoft.XMLHTTP'); xhr.open(method.toUpperCase(), url, async); if ('overrideMimeType' in xhr) xhr.overrideMimeType('text/plain'); diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index d4b71b96..8ddfdd17 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -380,7 +380,7 @@ Path.inject({ statics: new function() { sides = Base.readNamed(arguments, 'sides'), radius = Base.readNamed(arguments, 'radius'), step = 360 / sides, - three = !(sides % 3), + three = sides % 3 === 0, vector = new Point(0, three ? -radius : radius), offset = three ? -1 : 0.5, segments = new Array(sides);