- // Functions need to have a space following the opening { due to for web compatibility
- // see https://bugs.webkit.org/show_bug.cgi?id=24350
- // We also need \n before the closing } to handle // comments at the end of the last line
- UString program;
+ if (!globalObject->evalEnabled())
+ return exec->vm().throwException(exec, createEvalError(exec, globalObject->evalDisabledErrorMessage()));
+ return constructFunctionSkippingEvalEnabledCheck(exec, globalObject, args, functionName, sourceURL, position);
+}
+
+JSObject* constructFunctionSkippingEvalEnabledCheck(
+ ExecState* exec, JSGlobalObject* globalObject, const ArgList& args,
+ const Identifier& functionName, const String& sourceURL,
+ const TextPosition& position, int overrideLineNumber)
+{
+ // How we stringify functions is sometimes important for web compatibility.
+ // See https://bugs.webkit.org/show_bug.cgi?id=24350.
+ String program;