aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIgor Minar2011-07-17 00:47:11 -0700
committerIgor Minar2011-07-18 12:12:54 -0700
commit4c6d26a38f977f61d4deaacfd6b6c71f331e8065 (patch)
treefc291897c2e61097f2cabdf1963ed752704fd24a /src
parentc43ce91b2534fe36994fd74cf8d159e54909d8ca (diff)
downloadangular.js-4c6d26a38f977f61d4deaacfd6b6c71f331e8065.tar.bz2
fix(strict mode): fix all issues discovered by strict mode and unit/e2e tests
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js2
-rw-r--r--src/angular-mocks.js5
-rw-r--r--src/filters.js2
-rw-r--r--src/parser.js2
4 files changed, 5 insertions, 6 deletions
diff --git a/src/Angular.js b/src/Angular.js
index f28789d5..295be998 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -115,7 +115,7 @@ var _undefined = undefined,
angularCallbacks = extensionMap(angular, 'callbacks'),
nodeName_,
rngScript = /^(|.*\/)angular(-.*?)?(\.min)?.js(\?[^#]*)?(#(.*))?$/,
- uid = ['0', '0', '0'];
+ uid = ['0', '0', '0'],
DATE_ISOSTRING_LN = 24;
/**
diff --git a/src/angular-mocks.js b/src/angular-mocks.js
index 9154f8b5..2590c122 100644
--- a/src/angular-mocks.js
+++ b/src/angular-mocks.js
@@ -523,7 +523,8 @@ function TzDate(offset, timestamp) {
};
//hide all methods not implemented in this mock that the Date prototype exposes
- var unimplementedMethods = ['getMilliseconds', 'getTime', 'getUTCDay',
+ var self = this,
+ unimplementedMethods = ['getMilliseconds', 'getUTCDay',
'getUTCMilliseconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',
'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',
@@ -531,7 +532,7 @@ function TzDate(offset, timestamp) {
'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];
angular.forEach(unimplementedMethods, function(methodName) {
- this[methodName] = function() {
+ self[methodName] = function() {
throw {
name: "MethodNotImplemented",
message: "Method '" + methodName + "' is not implemented in the TzDate mock"
diff --git a/src/filters.js b/src/filters.js
index 491bb88e..f2cff14d 100644
--- a/src/filters.js
+++ b/src/filters.js
@@ -114,7 +114,7 @@ angularFilter.number = function(number, fractionSize){
pow = Math.pow(10, fractionSize),
whole = '' + number,
formatedText = '',
- i;
+ i, fraction;
if (whole.indexOf('e') > -1) return whole;
diff --git a/src/parser.js b/src/parser.js
index 0c4a391a..541addc4 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -290,11 +290,9 @@ function parser(text, json){
var token = peek(e1, e2, e3, e4);
if (token) {
if (json && !token.json) {
- index = token.index;
throwError("is not valid json", token);
}
tokens.shift();
- this.currentToken = token;
return token;
}
return false;