Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Do not fail for binary expressions involving "in" and "instanceof" (#…
- Loading branch information
1 parent
afddd9f
commit 4465018
Showing
4 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
description: 'Does not fail when bundling code where the `in`-operator is used with invalid right sides' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
if ('x' in null) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in undefined) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in 1) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in true) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in 'y') { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof null) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof undefined) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof 1) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof true) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof 'y') { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof {}) { | ||
console.log('retained'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
if ('x' in null) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in undefined) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in 1) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in true) { | ||
console.log('retained'); | ||
} | ||
|
||
if ('x' in 'y') { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof null) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof undefined) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof 1) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof true) { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof 'y') { | ||
console.log('retained'); | ||
} | ||
|
||
if (null instanceof {}) { | ||
console.log('retained'); | ||
} |