Skip to content
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

fixing regexp #19065

Merged
merged 3 commits into from Nov 2, 2018
Merged

fixing regexp #19065

merged 3 commits into from Nov 2, 2018

Conversation

prateekbh
Copy link
Member

  • Fixes the regexp for normal -> module js
    IIUC the change is required due to the new closure compiler declares global?global:this in a different way

@@ -31,8 +31,7 @@ const gulp = $$.help(require('gulp'));
exports.createModuleCompatibleES5Bundle = function(src) {
return gulp.src('dist/' + src)
.pipe($$.sourcemaps.init({loadMaps: true}))
.pipe($$.rename(src.replace(/\.js$/, '-module.js')))
.pipe($$.regexpSourcemaps(/(global\?global:\w*})\(this\)/, '$1(self)', 'module-global'))
.pipe($$.regexpSourcemaps(/(window.global\?window.global:\w*)this/, '$1self', 'module-global'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for my own knowledge how is the regexp name used (what is its usefulness)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jridgewell , i wanted to ask that too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's the filename this new code will be associated with.

@mrjoro
Copy link
Member

mrjoro commented Nov 2, 2018

@googlebot are you stuck?

@prateekbh prateekbh merged commit d0b8376 into ampproject:master Nov 2, 2018
@prateekbh prateekbh deleted the fix-esm-regexp branch November 2, 2018 20:36
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
* fixing regexp

* adding shadow v0 bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants