Skip to content

Commit

Permalink
fix: support goog.module calls after comments
Browse files Browse the repository at this point in the history
`goog.module` calls may be preceded by block comments `/* foo */goog.module`.

This change updates the heuristic regexp to handle that case.
  • Loading branch information
mprobst authored Feb 11, 2022
1 parent 9f60ff9 commit e8f82bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/googmodule.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var path = require('path');

// If the code has goog.module we need to wrap it.
var MODULE_REGEXP = /(^|;)\s*goog\.module\s*\(\s*['""]/m;
var MODULE_REGEXP = /(^|;|\*\/)\s*goog\.module\s*\(\s*['""]/m;
// If the code already has goog.base no wrapper even if goog.module.
var GOOGBASE_REGEXP = /^ \* @provideGoog *$/m;

Expand Down

0 comments on commit e8f82bb

Please sign in to comment.