Skip to content

Commit

Permalink
Fix regexp in mini_require to support windows-style line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Jul 19, 2022
1 parent b9fabd4 commit a194253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/kitchen-sink/mini_require.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@
if (!/^\w+:/.test(path)) path = host + path;
var onLoad = function(e, val) {
if (e) return processLoadQueue({id: id, path: path});
if (!/^(\s|\/\*([^*]|[*](?!\/))*\*\/|\/\/.*\n)*define\(function\(require/.test(val))
if (!/^(\s|\/\*([^*]|[*](?!\/))*\*\/|\/\/.*[\r]?\n)*define\(function\(require/.test(val))
val = "define(function(require, exports, module){" + val + "\n});"
nextModule = {name: id};
/* eslint no-eval:0 */
Expand Down

0 comments on commit a194253

Please sign in to comment.