Skip to content

Commit ef76afd

Browse files
Javier Mendiara Cañardojbdeboer
Javier Mendiara Cañardo
authored andcommitted
chore(Angular): remove superfluous fromCharCode function
Remove fromCharCode function as it was used only in two inner functions in the code, and its functionality is achieved in several other places by using String.fromCharCode Breaks fromCharCode closure function, String.fromCharCode should be used instead
1 parent 564963d commit ef76afd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Angular.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ var uppercase = function(string){return isString(string) ? string.toUpperCase()
2828

2929
var manualLowercase = function(s) {
3030
return isString(s)
31-
? s.replace(/[A-Z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) | 32);})
31+
? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
3232
: s;
3333
};
3434
var manualUppercase = function(s) {
3535
return isString(s)
36-
? s.replace(/[a-z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) & ~32);})
36+
? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
3737
: s;
3838
};
3939

@@ -46,8 +46,6 @@ if ('i' !== 'I'.toLowerCase()) {
4646
uppercase = manualUppercase;
4747
}
4848

49-
function fromCharCode(code) {return String.fromCharCode(code);}
50-
5149

5250
var /** holds major version number for IE or NaN for real browsers */
5351
msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]),

0 commit comments

Comments
 (0)