Skip to content

Commit

Permalink
Merge pull request #426 from canjs/landscaper/4217-use-strict
Browse files Browse the repository at this point in the history
Adds use strict. Fixes canjs/canjs#4217
  • Loading branch information
chasenlehara authored Jul 4, 2018
2 parents 8322c57 + 8d8cda2 commit e01fe88
Show file tree
Hide file tree
Showing 49 changed files with 79 additions and 27 deletions.
1 change: 1 addition & 0 deletions all.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("./can-connect");

connect.cacheRequests = require("./cache-requests/cache-requests");
Expand Down
1 change: 1 addition & 0 deletions base/base.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect/connect");
/**
* @module can-connect/base/base base
Expand Down
1 change: 1 addition & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var stealTools = require("steal-tools");
var path = require("path");
var fs = require("fs");
Expand Down
1 change: 1 addition & 0 deletions cache-requests/cache-requests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect");
var getItems = require("can-connect/helpers/get-items");
var canSet = require("can-set");
Expand Down
1 change: 1 addition & 0 deletions can-connect.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect/connect");
var base = require("can-connect/base/base");
var ns = require("can-namespace");
Expand Down
1 change: 1 addition & 0 deletions can/base-map/base-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect");

var constructor = require("../../constructor/constructor");
Expand Down
1 change: 1 addition & 0 deletions can/constructor-hydrate/constructor-hydrate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module {connect.Behavior} can-connect/can/constructor-hydrate/constructor-hydrate constructor-hydrate
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions can/map/make-real-time-super-model.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var constructor = require("can-connect/constructor/");
var canMap = require("can-connect/can/map/");
//var canRef = require("can-connect/can/ref/");
Expand Down
1 change: 1 addition & 0 deletions can/map/test-real-time-super-model.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var QUnit = require("steal-qunit");

var canLog = require("can-util/js/log/log");
Expand Down
1 change: 1 addition & 0 deletions can/merge/merge.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var smartMerge = require('can-connect/helpers/map-deep-merge');
var connectMap = require('can-connect/can/map/map');
var canBatch = require('can-event/batch/batch');
Expand Down
1 change: 1 addition & 0 deletions can/ref/ref.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module {connect.Behavior} can-connect/can/ref/ref can/ref
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions can/super-map/super-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect");

var constructor = require("../../constructor/constructor");
Expand Down
1 change: 1 addition & 0 deletions can/tag/tag.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module can-connect/can/tag/tag
* @parent can-connect.modules
Expand Down
5 changes: 4 additions & 1 deletion connect.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var assign = require("can-util/js/assign/assign");
/**
*
Expand Down Expand Up @@ -69,7 +70,9 @@ connect.behavior = function(name, behavior){
var behaviorMixin = function(base){
// basically Object.create
var Behavior = function(){};
Behavior.name = name;
Object.defineProperty(Behavior, "name", {
value: name
});
Behavior.prototype = base;
var newBehavior = new Behavior();
// allows behaviors to be a simple object, not always a function
Expand Down
1 change: 1 addition & 0 deletions constructor/callbacks-once/callbacks-once.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module {function} can-connect/constructor/callbacks-once/callbacks-once constructor/callbacks-once
* @parent can-connect.behaviors
Expand Down
2 changes: 2 additions & 0 deletions constructor/constructor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@


"use strict";

/**
* @module {connect.Behavior} can-connect/constructor/constructor constructor
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions constructor/store/store.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module {connect.Behavior} can-connect/constructor/store/store constructor/store
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions data/callbacks-cache/callbacks-cache.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module can-connect/data/callbacks-cache/callbacks-cache data/callbacks-cache
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions data/callbacks/callbacks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module can-connect/data/callbacks/callbacks data/callbacks
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions data/combine-requests/combine-requests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect");
var canSet = require("can-set");
var getItems = require("can-connect/helpers/get-items");
Expand Down
3 changes: 2 additions & 1 deletion data/localstorage-cache/localstorage-cache.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module can-connect/data/localstorage-cache/localstorage-cache localstorage-cache
* @parent can-connect.behaviors
Expand Down Expand Up @@ -401,7 +402,7 @@ module.exports = connect.behavior("data/localstorage-cache",function(baseConnect
// Get the data for the old set we can union with.
return this.getListData(setDatum.set).then(function(setData){
// update the old set to the new set
self.updateSet(setDatum, canSet.getUnion(setDatum.set, set, getItems(setData), items, this.algebra), union);
self.updateSet(setDatum, canSet.getUnion(setDatum.set, set, getItems(setData), items, self.algebra), union);
});
}
}
Expand Down
1 change: 1 addition & 0 deletions data/localstorage-cache/localstorage-cache_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ QUnit.asyncTest("pagination loses the bigger set (#126)", function(){
QUnit.start();
});
}).catch(function(e){
console.log(e);
QUnit.ok(false, "something broke");
QUnit.start();
});
Expand Down
1 change: 1 addition & 0 deletions data/memory-cache/memory-cache.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module can-connect/data/memory-cache/memory-cache memory-cache
* @parent can-connect.behaviors
Expand Down
7 changes: 4 additions & 3 deletions data/parse/parse.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module {connect.Behavior} can-connect/data/parse/parse
* @parent can-connect.behaviors
Expand Down Expand Up @@ -53,9 +54,9 @@
* ```
*
*/
var connect = require("can-connect");
var each = require("can-util/js/each/each");
var getObject = require("can-util/js/get/get");
var connect = require("can-connect");
var each = require("can-util/js/each/each");
var getObject = require("can-util/js/get/get");


module.exports = connect.behavior("data/parse",function(baseConnection){
Expand Down
45 changes: 23 additions & 22 deletions data/url/url.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module {connect.Behavior} can-connect/data/url/url data/url
* @parent can-connect.behaviors
Expand Down Expand Up @@ -211,28 +212,28 @@ var urlBehavior = connect.behavior("data/url", function(baseConnection) {
*/


/**
* @property {function} can-connect/data/url/url.ajax ajax
* @parent can-connect/data/url/url.option
*
* Specify the ajax functionality that should be used to make the request.
*
* @option {function} Provides an alternate function to be used to make
* ajax requests. By default [can-util/dom/ajax/ajax] provides the ajax
* functionality. jQuery's ajax method can be substituted as follows:
*
* ```js
* connect([
* require("can-connect/data/url/url")
* ],{
* url: "/things",
* ajax: $.ajax
* });
* ```
*
* @param {Object} settings Configuration options for the AJAX request.
* @return {Promise} A Promise that resolves to the data.
*/
/**
* @property {function} can-connect/data/url/url.ajax ajax
* @parent can-connect/data/url/url.option
*
* Specify the ajax functionality that should be used to make the request.
*
* @option {function} Provides an alternate function to be used to make
* ajax requests. By default [can-util/dom/ajax/ajax] provides the ajax
* functionality. jQuery's ajax method can be substituted as follows:
*
* ```js
* connect([
* require("can-connect/data/url/url")
* ],{
* url: "/things",
* ajax: $.ajax
* });
* ```
*
* @param {Object} settings Configuration options for the AJAX request.
* @return {Promise} A Promise that resolves to the data.
*/

// ## methodMetaData
// Metadata on different methods that is passed to makeAjax
Expand Down
1 change: 1 addition & 0 deletions data/worker/demo/todo_connection.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect");
var fixture = require("can-fixture");

Expand Down
1 change: 1 addition & 0 deletions data/worker/worker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var connect = require("can-connect");
var makeDeferred = require("can-connect/helpers/deferred");
var canLog = require("can-util/js/log/log");
Expand Down
1 change: 1 addition & 0 deletions docs/hooks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var hooks = {
// CRUD stuff
/**
Expand Down
1 change: 1 addition & 0 deletions fall-through-cache/fall-through-cache.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module can-connect/fall-through-cache/fall-through-cache fall-through-cache
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions helpers/clone-data.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var deepAssign = require("can-util/js/deep-assign/deep-assign");

module.exports = function(data) {
Expand Down
1 change: 1 addition & 0 deletions helpers/deferred.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

"use strict";
module.exports = function(){
var def = {};
def.promise = new Promise(function(resolve, reject){
Expand Down
1 change: 1 addition & 0 deletions helpers/deparam.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var digitTest = /^\d+$/,
keyBreaker = /([^\[\]]+)|(\[\])/g,
paramTest = /([^?#]*)(#.*)?$/,
Expand Down
1 change: 1 addition & 0 deletions helpers/get-id-props.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
module.exports = function(connection) {
var ids = [],
algebra = connection.algebra;
Expand Down
1 change: 1 addition & 0 deletions helpers/get-index-by-id.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/*jshint eqeqeq: false */
module.exports = function(connection, props, items){
var id = connection.id(props);
Expand Down
1 change: 1 addition & 0 deletions helpers/get-items.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
module.exports = function(data){
if(Array.isArray(data)) {
return data;
Expand Down
1 change: 1 addition & 0 deletions helpers/id-merge.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var map = [].map;

module.exports = function(list, update, id, make){
Expand Down
1 change: 1 addition & 0 deletions helpers/map-deep-merge.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
// TODO: This implementation deeply depends on `can-define/map/` and `can-define/list/`.
// Track the issue `https://github.com/canjs/canjs/issues/2931` to figure out how to apply smartMerge
// to regular objects and arrays.
Expand Down
1 change: 1 addition & 0 deletions helpers/overwrite.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
module.exports = function(d, s, id){
for(var prop in d) {
if(d.hasOwnProperty(prop) && !(prop.substr(0,2) === '__') && prop !== id && !(prop in s)) {
Expand Down
1 change: 1 addition & 0 deletions helpers/poly-weak-set.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var assign = require("can-util/js/assign/assign");

var PolyWeakSet = function(getKey){
Expand Down
1 change: 1 addition & 0 deletions helpers/remove-element.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var observer = new MutationObserver( function(mutations){
var mutation;
for(var i = 0; i < mutations.length; i++) {
Expand Down
1 change: 1 addition & 0 deletions helpers/set-add.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var canSet = require("can-set");
// This helper is used to add something to a set of data.
// if the set algebra doesn't know where to put it, we add it at the end.
Expand Down
1 change: 1 addition & 0 deletions helpers/sorted-set-json.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var forEach = [].forEach;
var keys = Object.keys;

Expand Down
1 change: 1 addition & 0 deletions helpers/validate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
// return wrapped can-connect behavior mixin that validates interface of the input behavior being extended
// deprecate this and use can-validate-interface decorator once available

Expand Down
1 change: 1 addition & 0 deletions helpers/weak-reference-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var assign = require("can-util/js/assign/assign");

/**
Expand Down
1 change: 1 addition & 0 deletions helpers/weak-reference-set.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var assign = require("can-util/js/assign/assign");


Expand Down
1 change: 1 addition & 0 deletions real-time/real-time.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* @module can-connect/real-time/real-time real-time
* @parent can-connect.behaviors
Expand Down
1 change: 1 addition & 0 deletions service-worker/service-worker-main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
console.log("WORKER - LISTENING");
addEventListener("message", function(ev){

Expand Down
1 change: 1 addition & 0 deletions service-worker/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

"use strict";
var connect = require("can-connect");
var makeDeferred = require("can-connect/helpers/deferred");
var canLog = require("can-util/js/log/log");
Expand Down
1 change: 1 addition & 0 deletions test-helpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
module.exports = {
makeStateChecker: function(QUnit, names){

Expand Down

0 comments on commit e01fe88

Please sign in to comment.