-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/parser): Fix detection of
use strict
directive (#8617)
**Description:** Directives should be at the start of the file, and this PR changes the parser to match only at the start of a file. **Related issue:** - Closes #8616.
- Loading branch information
Showing
8 changed files
with
78 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
var Module = (() => { | ||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; | ||
if (typeof __filename !== 'undefined') _scriptDir ||= __filename; | ||
return ( | ||
function (moduleArg = {}) { | ||
var Module = moduleArg; | ||
var readyPromiseResolve, readyPromiseReject; Module["ready"] = new Promise((resolve, reject) => { readyPromiseResolve = resolve; readyPromiseReject = reject }); "use strict"; | ||
|
||
|
||
return moduleArg | ||
} | ||
); | ||
})()(); | ||
if (typeof exports === 'object' && typeof module === 'object') | ||
module.exports = Module; | ||
else if (typeof define === 'function' && define['amd']) | ||
define([], () => Module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var Module = (function() { | ||
var _scriptDir = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : undefined; | ||
if (typeof __filename !== "undefined") _scriptDir || (_scriptDir = __filename); | ||
return function() { | ||
var moduleArg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | ||
var Module = moduleArg; | ||
var readyPromiseResolve, readyPromiseReject; | ||
Module["ready"] = new Promise(function(resolve, reject) { | ||
readyPromiseResolve = resolve; | ||
readyPromiseReject = reject; | ||
}); | ||
"use strict"; | ||
return moduleArg; | ||
}; | ||
})()(); | ||
if (typeof exports === "object" && typeof module === "object") module.exports = Module; | ||
else if (typeof define === "function" && define["amd"]) define([], function() { | ||
return Module; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters