Skip to content

Commit

Permalink
handle case when versionAdded === null
Browse files Browse the repository at this point in the history
  • Loading branch information
amilajack committed Feb 9, 2019
1 parent f96b6b0 commit 1f3c813
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
1 change: 1 addition & 0 deletions src/providers/MdnProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function mdnSupported(node: Node, { version, target }: Target): boolean {

// If a version is true then it is supported but version is unsure
if (typeof versionAdded === 'boolean') return versionAdded;
if (versionAdded === null) return false;
// A browser supports an API if its version is greater than or equal
// to the first version of the browser that API was added in
return semver.gte(
Expand Down
12 changes: 0 additions & 12 deletions test/e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@ ruleTester.run('compat', rule, {
}
],
invalid: [
{
code: 'new MediaRecorder()',
settings: {
browsers: ['ie 9']
},
errors: [
{
message: 'MediaRecorder is not supported in IE 9',
type: 'NewExpression'
}
]
},
{
code: 'new AnimationEvent',
settings: { browsers: ['chrome 40'] },
Expand Down

0 comments on commit 1f3c813

Please sign in to comment.