mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-10 06:52:05 +01:00
Use strict everywhere
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
app.compose(function() {
|
||||
"use strict";
|
||||
|
||||
var should = app.get('should')
|
||||
app.set('calc', {
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
app.compose(function(){
|
||||
app.compose(function() {
|
||||
"use strict";
|
||||
|
||||
var twoOperandsRegex = /^(\d+)\s*(<<|>>|\||\&|\^)\s*(\d+)$/;
|
||||
var numbersList = /^((\d*)+\s?)+$/;
|
||||
|
||||
|
||||
@@ -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('');
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
app.run(function() {
|
||||
"use strict";
|
||||
|
||||
var dispatcher = app.get('dispatcher');
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
app.compose(function() {
|
||||
"use strict";
|
||||
|
||||
app.controller('expressionInputCtrl', function (){
|
||||
var dispatcher = app.get('dispatcher');
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
app.compose(function() {
|
||||
"use strict";
|
||||
|
||||
app.set('dispatcher', function() {
|
||||
var handlers = [];
|
||||
var is = app.get('is');
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Expression View
|
||||
app.compose(function () {
|
||||
"use strict";
|
||||
|
||||
var formatter = app.get('formatter');
|
||||
var calc = app.get('calc');
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function(app) {
|
||||
"use strict";
|
||||
|
||||
function BitwiseOperation () {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function(app, core){
|
||||
"use strict";
|
||||
|
||||
app.set('html', core.HtmlBuilder);
|
||||
app.set('is', core.is);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function(app, core){
|
||||
"use strict";
|
||||
|
||||
var should = core.should;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function(app, core) {
|
||||
"use strict";
|
||||
|
||||
var should = core.should;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function(app) {
|
||||
"use strict";
|
||||
|
||||
function Template(html) {
|
||||
this.html = html;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
(function(app, is){
|
||||
"use strict";
|
||||
|
||||
app.modelView = function (modelCtor, builder) {
|
||||
var name = getKey(modelCtor);
|
||||
app.di.register(name, builder);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
(function() {
|
||||
|
||||
"use strict";
|
||||
|
||||
function AppShell(diContainer) {
|
||||
this.models = {};
|
||||
this.di = diContainer;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var bindr = {};
|
||||
|
||||
bindr.bindChildren = function(container, model) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Problems: no check for the circular references
|
||||
|
||||
(function(core){
|
||||
|
||||
|
||||
"use strict";
|
||||
var is = core.is;
|
||||
|
||||
function Container(store) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function(core){
|
||||
"use strict";
|
||||
|
||||
var HtmlBuilder = {};
|
||||
var should = core.should;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
window.core.is = {
|
||||
plainObject: function(obj) {
|
||||
return typeof obj == "object" && obj instanceof Object;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function(core){
|
||||
"use strict";
|
||||
var is = core.is;
|
||||
|
||||
function ObservableObject () {
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user