Skip to content

Commit e512174

Browse files
fix(ses): Do not crash under no-unsafe-eval Content Security Policy (#1333)
Co-authored-by: Kris Kowal <[email protected]>
1 parent a116534 commit e512174

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/ses/src/tame-function-constructors.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
defineProperties,
66
getPrototypeOf,
77
setPrototypeOf,
8+
freeze,
89
} from './commons.js';
910

1011
// This module replaces the original `Function` constructor, and the original
@@ -49,7 +50,7 @@ export default function tameFunctionConstructors() {
4950
FERAL_FUNCTION.prototype.constructor('return 1');
5051
} catch (ignore) {
5152
// Throws, no need to patch.
52-
return harden({});
53+
return freeze({});
5354
}
5455

5556
const newIntrinsics = {};

0 commit comments

Comments
 (0)