Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Commit a66b855

Browse files
author
Neil Fraser
committed
Fix string match with null return.
1 parent adfabd2 commit a66b855

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

interpreter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,8 +1102,8 @@ Interpreter.prototype.initString = function(scope) {
11021102
if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {
11031103
regexp = regexp.data;
11041104
}
1105-
var match = String(this).match(regexp);
1106-
return thisInterpreter.arrayNativeToPseudo(match);
1105+
var m = String(this).match(regexp);
1106+
return m && thisInterpreter.arrayNativeToPseudo(m);
11071107
};
11081108
this.setNativeFunctionPrototype(this.STRING, 'match', wrapper);
11091109

0 commit comments

Comments
 (0)