Skip to content

Commit f31f0e4

Browse files
committed
Merge pull request locutusjs#95 from tersmitten/typeof-is-not-a-function
Typeof is not a function
2 parents 6b555c5 + bfb0eda commit f31f0e4

22 files changed

+28
-28
lines changed

functions/_phpjs_shared/_phpjs_shared_bc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ function _phpjs_shared_bc () {
11181118
},
11191119

11201120
cint: function (v) {
1121-
if (typeof(v) == 'undefined') {
1121+
if (typeof v === 'undefined') {
11221122
v = 0;
11231123
}
11241124
var x = parseInt(v, 10);

functions/array/array_count_values.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function array_count_values (array) {
2727
};
2828

2929
var __countValue = function (value) {
30-
switch (typeof(value)) {
30+
switch (typeof value) {
3131
case "number":
3232
if (Math.floor(value) !== value) {
3333
return;

functions/array/array_walk_recursive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ function array_walk_recursive (array, funcname, userdata) {
1212
}
1313

1414
for (key in array) {
15-
if (typeof array[key] == 'object') {
15+
if (typeof array[key] === 'object') {
1616
return this.array_walk_recursive(array[key], funcname, userdata);
1717
}
1818

19-
if (typeof(userdata) != 'undefined') {
19+
if (typeof userdata !== 'undefined') {
2020
eval(funcname + '( array [key] , key , userdata )');
2121
} else {
2222
eval(funcname + '( userdata ) ');

functions/bc/bcadd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function bcadd (left_operand, right_operand, scale) {
1515

1616
var first, second, result;
1717

18-
if (typeof(scale) == 'undefined') {
18+
if (typeof scale === 'undefined') {
1919
scale = libbcmath.scale;
2020
}
2121
scale = ((scale < 0) ? 0 : scale);

functions/bc/bccomp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function bccomp (left_operand, right_operand, scale) {
1414
var libbcmath = this._phpjs_shared_bc();
1515

1616
var first, second; //bc_num
17-
if (typeof(scale) == 'undefined') {
17+
if (typeof scale === 'undefined') {
1818
scale = libbcmath.scale;
1919
}
2020
scale = ((scale < 0) ? 0 : scale);

functions/bc/bcdiv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function bcdiv (left_operand, right_operand, scale) {
2020

2121
var first, second, result;
2222

23-
if (typeof(scale) == 'undefined') {
23+
if (typeof scale === 'undefined') {
2424
scale = libbcmath.scale;
2525
}
2626
scale = ((scale < 0) ? 0 : scale);

functions/bc/bcmul.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function bcmul (left_operand, right_operand, scale) {
1616

1717
var first, second, result;
1818

19-
if (typeof(scale) == 'undefined') {
19+
if (typeof scale === 'undefined') {
2020
scale = libbcmath.scale;
2121
}
2222
scale = ((scale < 0) ? 0 : scale);

functions/bc/bcsub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function bcsub (left_operand, right_operand, scale) {
1717

1818
var first, second, result;
1919

20-
if (typeof(scale) == 'undefined') {
20+
if (typeof scale === 'undefined') {
2121
scale = libbcmath.scale;
2222
}
2323
scale = ((scale < 0) ? 0 : scale);

functions/datetime/getdate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ function getdate (timestamp) {
77
// * returns 1: {'seconds': 40, 'minutes': 58, 'hours': 21, 'mday': 17, 'wday': 2, 'mon': 6, 'year': 2003, 'yday': 167, 'weekday': 'Tuesday', 'month': 'June', '0': 1055901520}
88
var _w = ['Sun', 'Mon', 'Tues', 'Wednes', 'Thurs', 'Fri', 'Satur'];
99
var _m = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
10-
var d = ((typeof(timestamp) == 'undefined') ? new Date() : // Not provided
11-
(typeof(timestamp) == 'object') ? new Date(timestamp) : // Javascript Date()
10+
var d = ((typeof timestamp === 'undefined') ? new Date() : // Not provided
11+
(typeof timestamp === 'object') ? new Date(timestamp) : // Javascript Date()
1212
new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
1313
);
1414
var w = d.getDay();

functions/datetime/gmstrftime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ function gmstrftime (format, timestamp) {
66
// - depends on: strftime
77
// * example 1: gmstrftime("%A", 1062462400);
88
// * returns 1: 'Tuesday'
9-
var dt = ((typeof(timestamp) == 'undefined') ? new Date() : // Not provided
10-
(typeof(timestamp) == 'object') ? new Date(timestamp) : // Javascript Date()
9+
var dt = ((typeof timestamp === 'undefined') ? new Date() : // Not provided
10+
(typeof timestamp === 'object') ? new Date(timestamp) : // Javascript Date()
1111
new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
1212
);
1313
timestamp = Date.parse(dt.toUTCString().slice(0, -4)) / 1000;

0 commit comments

Comments
 (0)