Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9aa3715

Browse files
authored
Merge pull request atom#1448 from atom/aw/return-non-match-singleton
URIPattern.match() returns a URIMatch
2 parents 6e8f1b8 + 1cc45d8 commit 9aa3715

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/atom/uri-pattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class URIPattern {
5959

6060
matches(string) {
6161
if (string === undefined || string === null) {
62-
return false;
62+
return nonURIMatch;
6363
}
6464

6565
const other = url.parse(string, true);

test/atom/uri-pattern.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('URIPattern', function() {
2020
});
2121

2222
it('does not match undefined or null', function() {
23-
assert.isFalse(exact.matches(undefined));
24-
assert.isFalse(exact.matches(null));
23+
assert.isFalse(exact.matches(undefined).ok());
24+
assert.isFalse(exact.matches(null).ok());
2525
});
2626
});
2727

0 commit comments

Comments
 (0)