We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f20135 commit caaa1c5Copy full SHA for caaa1c5
src/utils/evalInContext.js
@@ -1,3 +1,9 @@
1
+/**
2
+ * evaluate es5 code in the browser
3
+ * and return value if there s a return statement
4
+ * @param {*} code the body of the funtion to exectute
5
+ * @param {*} require the fake function require
6
+ */
7
export default function evalInContext(code, require) {
8
// eslint-disable-next-line no-new-func
9
const func = new Function("require", code);
0 commit comments