fix up test styling and add use-strict declarator

This commit is contained in:
Sebastian McKenzie
2014-10-18 15:42:36 +11:00
parent 6c48e6cd66
commit dcaea68240
198 changed files with 697 additions and 447 deletions

View File

@@ -1,8 +1,11 @@
"use strict";
function add() {
var _arguments = arguments;
return [1, 2, 3].map(function (i) {
return [1, 2, 3].map(function(i) {
return i * _arguments[0];
});
}
add(5);
add(5);

View File

@@ -1,7 +1,10 @@
var seattlers = function () {
"use strict";
var seattlers = function() {
var _arr = [];
countries.forEach(function (customers) {
customers.forEach(function (c) {
countries.forEach(function(customers) {
customers.forEach(function(c) {
if (c.city == "Seattle") {
_arr.push({
name: c.name,
@@ -10,5 +13,6 @@ var seattlers = function () {
}
});
});
return _arr;
}();
}();

View File

@@ -1,11 +1,13 @@
var arr = (function () {
"use strict";
var arr = function() {
var _arr = [];
"abcdefgh".split("").forEach(function (x) {
"12345678".split("").forEach(function (y) {
"abcdefgh".split("").forEach(function(x) {
"12345678".split("").forEach(function(y) {
_arr.push(x + y);
});
});
return _arr;
})();
}();

View File

@@ -1,8 +1,10 @@
var seattlers = customers.filter(function (c) {
"use strict";
var seattlers = customers.filter(function(c) {
return c.city == "Seattle";
}).map(function (c) {
}).map(function(c) {
return {
name: c.name,
age: c.age
};
});
});

View File

@@ -1,3 +1,5 @@
var arr = [1, 2, 3].map(function (i) {
"use strict";
var arr = [1, 2, 3].map(function(i) {
return i * i;
});
});

View File

@@ -1,8 +1,13 @@
"use strict";
function add() {
var _this = this;
return [1, 2, 3].map(function (i) {
return [1, 2, 3].map(function(i) {
return i * _this.multiplier;
});
}
add.call({ multiplier: 5 });
add.call({
multiplier: 5
});