Skip to content

Commit

Permalink
move all 「'use strict';」 to the first line of the file or,
Browse files Browse the repository at this point in the history
for files directly loaded by the browser, the file closure
(avoids enabling it on browser-global scope)

this works around the remaining issues with the newer babel
  • Loading branch information
mirabilos committed Jan 10, 2025
1 parent 87c2c05 commit 3a7b72a
Show file tree
Hide file tree
Showing 29 changed files with 53 additions and 38 deletions.
4 changes: 2 additions & 2 deletions auto_tests/tests/PixelSampler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

// Copyright 2012 Google Inc. All Rights Reserved.

/**
Expand All @@ -7,8 +9,6 @@
* @license MIT
*/

'use strict';

/**
* @constructor
*/
Expand Down
3 changes: 2 additions & 1 deletion common/textarea.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

// Copyright (c) 2012 Google, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -23,7 +25,6 @@
*
* @author konigsberg@google.com (Robert Konigsberg)
*/
"use strict";

function TextArea(parent) {
var body = document.getElementsByTagName("body")[0];
Expand Down
3 changes: 2 additions & 1 deletion src/datahandler/bars-custom.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2013 David Eberlein (david.eberlein@ch.sauter-bc.com)
Expand All @@ -10,7 +12,6 @@
*/

/*global Dygraph:false */
"use strict";

import BarsHandler from './bars';

Expand Down
3 changes: 2 additions & 1 deletion src/datahandler/bars-error.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2013 David Eberlein (david.eberlein@ch.sauter-bc.com)
Expand All @@ -10,7 +12,6 @@
*/

/*global Dygraph:false */
"use strict";

import BarsHandler from './bars';

Expand Down
3 changes: 2 additions & 1 deletion src/datahandler/bars-fractions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2013 David Eberlein (david.eberlein@ch.sauter-bc.com)
Expand All @@ -11,7 +13,6 @@
*/

/*global Dygraph:false */
"use strict";

import BarsHandler from './bars';

Expand Down
3 changes: 2 additions & 1 deletion src/datahandler/bars.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2013 David Eberlein (david.eberlein@ch.sauter-bc.com)
Expand All @@ -13,7 +15,6 @@

/*global Dygraph:false */
/*global DygraphLayout:false */
"use strict";

import DygraphDataHandler from './datahandler';
import DygraphLayout from '../dygraph-layout';
Expand Down
4 changes: 2 additions & 2 deletions src/datahandler/datahandler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2013 David Eberlein (david.eberlein@ch.sauter-bc.com)
Expand Down Expand Up @@ -41,8 +43,6 @@
/*global Dygraph:false */
/*global DygraphLayout:false */

"use strict";

/**
*
* The data handler is responsible for all data specific operations. All of the
Expand Down
3 changes: 2 additions & 1 deletion src/datahandler/default-fractions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2013 David Eberlein (david.eberlein@ch.sauter-bc.com)
Expand All @@ -10,7 +12,6 @@
*/

/*global Dygraph:false */
"use strict";

import DygraphDataHandler from './datahandler';
import DefaultHandler from './default';
Expand Down
3 changes: 2 additions & 1 deletion src/datahandler/default.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2013 David Eberlein (david.eberlein@ch.sauter-bc.com)
Expand All @@ -10,7 +12,6 @@
*/

/*global Dygraph:false */
"use strict";

import DygraphDataHandler from './datahandler';

Expand Down
3 changes: 2 additions & 1 deletion src/dygraph-canvas.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2006 Dan Vanderkam (danvdk@gmail.com)
Expand Down Expand Up @@ -25,7 +27,6 @@
*/

/*global Dygraph:false */
"use strict";

import * as utils from './dygraph-utils';
import Dygraph from './dygraph';
Expand Down
2 changes: 1 addition & 1 deletion src/dygraph-default-attrs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'
'use strict';

import * as DygraphTickers from './dygraph-tickers';
import DygraphInteraction from './dygraph-interaction-model';
Expand Down
3 changes: 2 additions & 1 deletion src/dygraph-gviz.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -18,7 +20,6 @@
*/

/*global Dygraph:false */
"use strict";

import Dygraph from './dygraph';

Expand Down
3 changes: 2 additions & 1 deletion src/dygraph-interaction-model.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2011 Robert Konigsberg (konigsberg@google.com)
Expand All @@ -11,7 +13,6 @@
*/

/*global Dygraph:false */
"use strict";

import * as utils from './dygraph-utils';

Expand Down
3 changes: 2 additions & 1 deletion src/dygraph-layout.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -10,7 +12,6 @@
*/

/*global Dygraph:false */
"use strict";

import * as utils from './dygraph-utils';

Expand Down
4 changes: 2 additions & 2 deletions src/dygraph-options-reference.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

/**
* @license
* Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
* MIT-licenced: https://opensource.org/licenses/MIT
*/

"use strict";

var OPTIONS_REFERENCE = null;

if (typeof process !== 'undefined' && process.env.NODE_ENV != 'production') {
Expand Down
3 changes: 2 additions & 1 deletion src/dygraph-options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -11,7 +13,6 @@

// TODO: remove this jshint directive & fix the warnings.
/*jshint sub:true */
"use strict";

import * as utils from './dygraph-utils';
import DEFAULT_ATTRS from './dygraph-default-attrs';
Expand Down
3 changes: 2 additions & 1 deletion src/dygraph-tickers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
Expand Down Expand Up @@ -62,7 +64,6 @@

/*jshint sub:true */
/*global Dygraph:false */
"use strict";

import * as utils from './dygraph-utils';

Expand Down
3 changes: 2 additions & 1 deletion src/dygraph-utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -12,7 +14,6 @@
*/

/*global Dygraph:false, Node:false */
"use strict";

import * as DygraphTickers from './dygraph-tickers';

Expand Down
4 changes: 2 additions & 2 deletions src/dygraph.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2006 Dan Vanderkam (danvdk@gmail.com)
Expand Down Expand Up @@ -73,8 +75,6 @@ import RangeSelectorPlugin from './plugins/range-selector';

import GVizChart from './dygraph-gviz';

"use strict";

/**
* @class Creates an interactive, zoomable chart.
* @name Dygraph
Expand Down
2 changes: 1 addition & 1 deletion src/extras/crosshair.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (window.Dygraph) {
/* end of loader wrapper header */

Dygraph.Plugins.Crosshair = (function _extras_crosshair_closure() {
"use strict";
'use strict';

/**
* Creates the crosshair
Expand Down
2 changes: 1 addition & 1 deletion src/extras/hairlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (window.Dygraph) {

Dygraph.Plugins.Hairlines = (function _extras_hairlines_closure() {

"use strict";
'use strict';

/**
* @typedef {
Expand Down
2 changes: 1 addition & 1 deletion src/extras/super-annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (window.Dygraph) {

Dygraph.Plugins.SuperAnnotations = (function _extras_superAnnotations_closure() {

"use strict";
'use strict';

/**
* These are just the basic requirements -- annotations can have whatever other
Expand Down
3 changes: 1 addition & 2 deletions src/extras/unzoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ if (window.Dygraph) {
* @author konigsberg@google.com (Robert Konigsberg)
*/
Dygraph.Plugins.Unzoom = (function _extras_unzoom_closure() {

"use strict";
'use strict';

/**
* Create a new instance.
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/annotations.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -6,8 +8,6 @@

/*global Dygraph:false */

"use strict";

/**
Current bits of jankiness:
- Uses dygraph.layout_ to get the parsed annotations.
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/axes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -6,8 +8,6 @@

/*global Dygraph:false */

'use strict';

/*
Bits of jankiness:
- Direct layout access
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/chart-labels.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';

/**
* @license
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
* MIT-licenced: https://opensource.org/licenses/MIT
*/
/*global Dygraph:false */

"use strict";

// TODO(danvk): move chart label options out of dygraphs and into the plugin.
// TODO(danvk): only tear down & rebuild the DIVs when it's necessary.

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grid.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -13,8 +15,6 @@ Current bits of jankiness:
*/

"use strict";

/**
* Draws the gridlines, i.e. the gray horizontal & vertical lines running the
* length of the chart.
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/legend.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2012 Dan Vanderkam (danvdk@gmail.com)
Expand All @@ -15,7 +17,6 @@ Current bits of jankiness:
*/

/*global Dygraph:false */
"use strict";

import * as utils from '../dygraph-utils';

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/range-selector.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* @license
* Copyright 2011 Paul Felix (paul.eric.felix@gmail.com)
Expand All @@ -11,7 +13,6 @@
*/

/*global Dygraph:false */
"use strict";

import * as utils from '../dygraph-utils';
import DygraphInteraction from '../dygraph-interaction-model';
Expand Down

0 comments on commit 3a7b72a

Please sign in to comment.