Skip to content

Commit

Permalink
Use JavaScript's strict mode
Browse files Browse the repository at this point in the history
No further adaptions necessary, also tested usages of "this" and
"call()".

Strict mode has been activated for all .js files except index.js because
"test main preferences keep" failed with an exception then. Removing
"use strict" from test/test-index.js did not fix behaviour.
marcows committed May 2, 2019
1 parent ee8eb7f commit 537ce3c
Showing 13 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/contextmaps.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
* Content script for the context menu with the destination maps.
*/

"use strict";

/*
* Handle the event when a context menu item has been clicked.
*/
2 changes: 2 additions & 0 deletions data/editmaps.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
* UI for configuring and selecting the used destination maps.
*/

"use strict";

var draggedEl;

function handleDragStart(ev)
2 changes: 2 additions & 0 deletions data/geosite.js
Original file line number Diff line number Diff line change
@@ -23,6 +23,8 @@
* @type {GeositeInfo}
*/

"use strict";

var scanners = [
{
func: scanGeosite_Wikipedia,
2 changes: 2 additions & 0 deletions data/geosite/flickr.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
* Part of content script {@link module:data/geosite}.
*/

"use strict";

/*
* Scanner for Flickr photo site.
*
2 changes: 2 additions & 0 deletions data/geosite/geotag.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
* Part of content script {@link module:data/geosite}.
*/

"use strict";

/*
* Scanner for geo tags.
*
2 changes: 2 additions & 0 deletions data/geosite/wikipedia.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
* Part of content script {@link module:data/geosite}.
*/

"use strict";

/*
* Scanner for Wikipedia.
*
2 changes: 2 additions & 0 deletions data/geosite/wikivoyage.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
* Part of content script {@link module:data/geosite}.
*/

"use strict";

/*
* Scanner for Wikivoyage.
*
1 change: 1 addition & 0 deletions data/usemaps.js
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
* @event pagesize
*/

"use strict";

/**
* Handle a click on a panel link.
2 changes: 2 additions & 0 deletions lib/geourl.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
* @module
*/

"use strict";

var parsers = [
parseGeoURL_GeoURI,
parseGeoURL_OSMnewstyle,
2 changes: 2 additions & 0 deletions lib/mapcoords.js
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@
* @global
*/

"use strict";

// Default osmzoom if no zoom/scale is given
const DEFAULT_ZOOM = 15;

2 changes: 2 additions & 0 deletions test/test-geourl.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

var geourl = require("../lib/geourl.js");

var testdata = require("./testurls.json");
2 changes: 2 additions & 0 deletions test/test-index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

var main = require("../");
var preferences = require("sdk/simple-prefs");

2 changes: 2 additions & 0 deletions test/test-mapcoords.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

var mapcoords = require("../lib/mapcoords.js");

var testdata = require("./testcoords.json");

0 comments on commit 537ce3c

Please sign in to comment.