-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: RollupJS reexports detection #59
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -651,8 +651,10 @@ function tryParseObjectDefineOrKeys (keys) { | |
if (ch !== 33/*!*/) break; | ||
pos += 1; | ||
ch = commentWhitespace(); | ||
if (source.startsWith(id, pos)) { | ||
pos += id.length; | ||
if (ch === 79/*O*/ && source.startsWith('bject', pos + 1) && source[pos + 6] === '.') { | ||
if (!tryParseObjectHasOwnProperty(it_id)) break; | ||
} | ||
Comment on lines
+654
to
+656
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has just been moved here from the old There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the order switch is so that |
||
else if (identifier()) { | ||
ch = commentWhitespace(); | ||
if (ch !== 46/*.*/) break; | ||
pos++; | ||
|
@@ -669,7 +671,7 @@ function tryParseObjectDefineOrKeys (keys) { | |
if (ch !== 41/*)*/) break; | ||
pos += 1; | ||
} | ||
else if (!tryParseObjectHasOwnProperty(it_id)) break; | ||
else break; | ||
ch = commentWhitespace(); | ||
} | ||
if (ch !== 41/*)*/) break; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or well, maybe not because
EXPORTS_IDENTIFIER
also allowsmodule.exports
. But we should expect the exactexports
identifier, not a generic one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason this is generic is due to the export names object check for Babel here - https://github.com/guybedford/cjs-module-lexer/blob/master/test/_unit.js#L171.