Skip to content

Commit a62a62a

Browse files
committed
Fixed sort#2
1 parent cd22619 commit a62a62a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

functions/array/sort.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ function sort (inputArr, sort_flags) {
2525
// * example 2: ini_set('phpjs.strictForIn', true);
2626
// * example 2: fruits = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
2727
// * example 2: sort(fruits);
28-
// * results 2: fruits == {0: 'apple', 1: 'banana', 2: 'lemon', 3: 'orange'}
29-
// * returns 2: true
28+
// * example 2: fruits;
29+
// * returns 2: {0: 'apple', 1: 'banana', 2: 'lemon', 3: 'orange'}
30+
3031
var valArr = [],
3132
keyArr = [],
3233
k = '',
@@ -75,7 +76,12 @@ function sort (inputArr, sort_flags) {
7576
}
7677

7778
// BEGIN REDUNDANT
78-
this.php_js = this.php_js || {};
79+
try {
80+
this.php_js = this.php_js || {};
81+
} catch (e) {
82+
this.php_js = {};
83+
}
84+
7985
this.php_js.ini = this.php_js.ini || {};
8086
// END REDUNDANT
8187
strictForIn = this.php_js.ini['phpjs.strictForIn'] && this.php_js.ini['phpjs.strictForIn'].local_value && this.php_js.ini['phpjs.strictForIn'].local_value !== 'off';

functions/strings/money_format.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ function money_format (format, number) {
44
// + input by: daniel airton wermann (http://wermann.com.br)
55
// + bugfixed by: Brett Zamir (http://brett-zamir.me)
66
// - depends on: setlocale
7-
// % note 1: This depends on setlocale having the appropriate locale (these examples use 'en_US')
7+
// % note 1: This depends on setlocale having the appropriate
8+
// % note 1: locale (these examples use 'en_US')
89
// * example 1: money_format('%i', 1234.56);
910
// * returns 1: 'USD 1,234.56'
1011
// * example 2: money_format('%14#8.2n', 1234.5678);

0 commit comments

Comments
 (0)