-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ses): hostEvaluators lockdown option
- Loading branch information
Showing
8 changed files
with
129 additions
and
36 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
/** | ||
* makeEvalFunction() | ||
* A safe version of the native eval function which relies on | ||
* the safety of safeEvaluate for confinement. | ||
* the safety of safeEvaluate for confinement, unless noEval | ||
* is specified (then a TypeError is thrown). | ||
* | ||
* @param {Function} safeEvaluate | ||
* @param {Function} evaluator | ||
* @param legacyHermesTaming | ||
Check warning on line 8 in packages/ses/src/make-eval-function.js
|
||
*/ | ||
export const makeEvalFunction = safeEvaluate => { | ||
export const makeEvalFunction = evaluator => { | ||
// We use the concise method syntax to create an eval without a | ||
// [[Construct]] behavior (such that the invocation "new eval()" throws | ||
// TypeError: eval is not a constructor"), but which still accepts a | ||
|
@@ -19,7 +21,7 @@ export const makeEvalFunction = safeEvaluate => { | |
// rule. Track. | ||
return source; | ||
} | ||
return safeEvaluate(source); | ||
return evaluator(source); | ||
}, | ||
}.eval; | ||
|
||
|
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