Skip to content

Commit

Permalink
[TIMOB-20297] Support hyphens in require replace regex (#95)
Browse files Browse the repository at this point in the history
Hyperloop replaces require calls to native classes with the Hyperloop
layer. The used regex to detect requires with native classes could not
handle hyphens. This commit fixes the regex.
  • Loading branch information
janvennemann authored and hansemannn committed Oct 17, 2016
1 parent c0bdf2e commit aaac9c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iphone/plugin/hyperloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ HyperloopiOSBuilder.prototype.patchJSFile = function patchJSFile(sourceFilename,
// get the result source code in case it was transformed and replace all system framework
// require() calls with the Hyperloop layer
var newContents = (this.parserState.getSourceCode() || contents).replace(
/require\s*\([\\"']+([\w_/-\\.]+)[\\"']+\)/ig,
/require\s*\([\\"']+([\w_/\-\\.]+)[\\"']+\)/ig,
function (orig, match) {
// hyperloop includes will always have a slash
var tok = match.split('/');
Expand Down

0 comments on commit aaac9c6

Please sign in to comment.