Use strict everywhere

This commit is contained in:
Borys Levytskyi
2015-04-04 19:27:52 +03:00
parent ba284789ba
commit f14425da75
20 changed files with 50 additions and 31 deletions

View File

@@ -1,4 +1,6 @@
app.compose(function() {
"use strict";
var should = app.get('should')
app.set('calc', {

View File

@@ -1,4 +1,6 @@
app.compose(function(){
app.compose(function() {
"use strict";
var twoOperandsRegex = /^(\d+)\s*(<<|>>|\||\&|\^)\s*(\d+)$/;
var numbersList = /^((\d*)+\s?)+$/;

View File

@@ -1,32 +1,27 @@
(function(should, app){
app.compose(function() {
"use strict";
app.compose(function() {
var should = app.get('should');
app.set("formatter", {
toBinaryString: function(num, totalLength) {
var should = app.get('should');
app.set("formatter", {
toBinaryString: function(num, totalLength) {
var binaryStr = num.toString(2),
formatted = [],
i;
var binaryStr = num.toString(2),
formatted = [],
i;
if(totalLength != null) {
should.bePositiveInteger(totalLength);
}
if(totalLength != null) {
should.bePositiveInteger(totalLength);
}
for(i = 0; i<binaryStr.length; i++) {
formatted.push(binaryStr[i]);
}
while(totalLength > formatted.length) {
formatted.unshift('0');
}
return formatted.join('');
}
});
})
})(window.should, window.app);
for(i = 0; i<binaryStr.length; i++) {
formatted.push(binaryStr[i]);
}
while(totalLength > formatted.length) {
formatted.unshift('0');
}
return formatted.join('');
}
});
})

View File

@@ -1,4 +1,5 @@
app.run(function() {
"use strict";
var dispatcher = app.get('dispatcher');

View File

@@ -1,4 +1,5 @@
app.compose(function() {
"use strict";
app.controller('expressionInputCtrl', function (){
var dispatcher = app.get('dispatcher');

View File

@@ -1,4 +1,6 @@
app.compose(function() {
"use strict";
app.set('dispatcher', function() {
var handlers = [];
var is = app.get('is');

View File

@@ -1,5 +1,6 @@
// Expression View
app.compose(function () {
"use strict";
var formatter = app.get('formatter');
var calc = app.get('calc');

View File

@@ -1,4 +1,5 @@
(function(app) {
"use strict";
function BitwiseOperation () {
}

View File

@@ -1,4 +1,5 @@
(function(app, core){
"use strict";
app.set('html', core.HtmlBuilder);
app.set('is', core.is);

View File

@@ -1,4 +1,5 @@
(function(app, core){
"use strict";
var should = core.should;

View File

@@ -1,4 +1,5 @@
(function(app, core) {
"use strict";
var should = core.should;

View File

@@ -1,4 +1,5 @@
(function(app) {
"use strict";
function Template(html) {
this.html = html;

View File

@@ -1,4 +1,6 @@
(function(app, is){
"use strict";
app.modelView = function (modelCtor, builder) {
var name = getKey(modelCtor);
app.di.register(name, builder);

View File

@@ -1,5 +1,6 @@
(function() {
"use strict";
function AppShell(diContainer) {
this.models = {};
this.di = diContainer;

View File

@@ -1,4 +1,6 @@
(function(){
"use strict";
var bindr = {};
bindr.bindChildren = function(container, model) {

View File

@@ -1,7 +1,6 @@
// Problems: no check for the circular references
(function(core){
"use strict";
var is = core.is;
function Container(store) {

View File

@@ -1,4 +1,5 @@
(function(core){
"use strict";
var HtmlBuilder = {};
var should = core.should;

View File

@@ -1,4 +1,6 @@
(function(){
"use strict";
window.core.is = {
plainObject: function(obj) {
return typeof obj == "object" && obj instanceof Object;

View File

@@ -1,4 +1,5 @@
(function(core){
"use strict";
var is = core.is;
function ObservableObject () {

View File

@@ -1,4 +1,6 @@
(function(){
"use strict";
window.core.should = {
beNumber: function (num, name) {
this.check(typeof num == "number" && !isNaN(num), num + " is not a number");