Skip to content

Commit be80d9b

Browse files
committed
Update __chakraLibrary.CheckArrayAndGetLen to correctly check for null/undefined
1 parent d47dbd3 commit be80d9b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/Runtime/Library/JsBuiltIn/JsBuiltIn.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,12 @@
193193
"use strict";
194194

195195
if (__chakraLibrary.isArray(obj)) {
196-
return { o: obj, len: obj.length }
197-
}
198-
else {
199-
if (this === null || this === undefined) {
196+
return { o: obj, len: obj.length };
197+
} else {
198+
if (obj === null || obj === undefined) {
200199
__chakraLibrary.raiseThis_NullOrUndefined(builtInFunc);
201200
}
202-
return { o: __chakraLibrary.Object(obj), len: __chakraLibrary.GetLength(obj) }
201+
return { o: __chakraLibrary.Object(obj), len: __chakraLibrary.GetLength(obj) };
203202
}
204203
});
205204

0 commit comments

Comments
 (0)