-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
followup for issues in #2000 #2100
Conversation
also update closure for mid-month release
'report/v2/renderer/*.js', | ||
]) | ||
|
||
// Ignore `module.exports` and `self.ClassName = ClassName` statements. | ||
.pipe(replace(/^\s\smodule\.exports = \w+;$/gm, ';')) | ||
.pipe(replace(/^\s\sself\.(\w+) = \1;$/gm, ';')) | ||
|
||
// Remove node-specific code from file-namer so it can be included in report. |
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.
kind of dumb to do such a custom solution for just this file, but since this is the only file that's completely intended to live in both node and the browser (all the other renderer files are only used in node for testing), I went with it. If/when we have more files that need to live in both worlds we can add a more general solution.
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.
fine by me
@@ -64,7 +64,7 @@ class ReportUIFeatures { | |||
* Fires a custom DOM event on target. | |||
* @param {string} name Name of the event. | |||
* @param {!Node=} target DOM node to fire the event on. | |||
* @param {Object<{detail: Object<string, *>}>=} detail Custom data to include. | |||
* @param {*=} detail Custom data to include. |
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.
😱
(just kidding)
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.
hehe, that's what it really is! https://dom.spec.whatwg.org/#dictdef-customeventinit
dictionary CustomEventInit : EventInit {
any detail = null;
};
'report/v2/renderer/*.js', | ||
]) | ||
|
||
// Ignore `module.exports` and `self.ClassName = ClassName` statements. | ||
.pipe(replace(/^\s\smodule\.exports = \w+;$/gm, ';')) | ||
.pipe(replace(/^\s\sself\.(\w+) = \1;$/gm, ';')) | ||
|
||
// Remove node-specific code from file-namer so it can be included in report. | ||
.pipe(replace(/^\s\smodule\.exports = {\w+};$/gm, ';')) |
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.
happens to not match the module.exports
line in the renderer files:
module.exports = ReportRenderer;
but yah this seems to be the right solution.
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.
that should be caught by the existing.pipe(replace(/^\s\smodule\.exports = \w+;$/gm, ';'))
above.
I also turned module.exports
to write-only, so anything that ends up tricking the regexes will fail the compile :)
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.
write-only
by which I obviously mean read-only
also update closure for mid-month release
@paulirish this will hopefully make #2099 a bit smoother