first commit
This commit is contained in:
29
build/node_modules/prepack/lib/utils/strict.js
generated
vendored
Normal file
29
build/node_modules/prepack/lib/utils/strict.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = IsStrict;
|
||||
function IsStrict(node) {
|
||||
if (node.strict) return true;
|
||||
if (node.type !== "BlockStatement" && node.type !== "Program") return false;
|
||||
var directives = node.directives;
|
||||
if (!directives) return false;
|
||||
return directives.some(function (directive) {
|
||||
if (directive.type !== "Directive") {
|
||||
return false;
|
||||
}
|
||||
if (directive.value.type !== "DirectiveLiteral") {
|
||||
return false;
|
||||
}
|
||||
return directive.value.value === "use strict";
|
||||
});
|
||||
} /**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
//# sourceMappingURL=strict.js.map
|
||||
Reference in New Issue
Block a user