loop over all directives to check for use strict
This commit is contained in:
parent
8a13465f80
commit
eae82799e6
@ -793,9 +793,14 @@ pp.parseFunctionBody = function (node, allowExpression) {
|
|||||||
if (allowExpression) checkLVal = true;
|
if (allowExpression) checkLVal = true;
|
||||||
|
|
||||||
// normal function
|
// normal function
|
||||||
if (!isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) {
|
if (!isExpression && node.body.directives.length) {
|
||||||
checkLVal = true;
|
for (var directive of (node.body.directives: Array)) {
|
||||||
checkLValStrict = true;
|
if (directive.value === "use strict") {
|
||||||
|
checkLVal = true;
|
||||||
|
checkLValStrict = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkLVal) {
|
if (checkLVal) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user