Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: src/contexts.cc

Issue 10837358: Throw a more descriptive exception when blocking 'eval' via CSP. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add SetErrorMessageForCodeGenerationFromStrings API function. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/contexts.h ('k') | src/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index 169d9a12232772a523145e2b3c45db186f02bb1e..93c9795404bb52690c6cc3c4e1b560b4f9a076c6 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -305,6 +305,18 @@ void Context::ClearOptimizedFunctions() {
}
+Handle<Object> Context::ErrorMessageForCodeGenerationFromStrings() {
+ Handle<Object> result(error_message_for_code_gen_from_strings());
+ if (result->IsUndefined()) {
+ const char* error =
+ "Code generation from strings disallowed for this context";
+ Isolate* isolate = Isolate::Current();
+ result = isolate->factory()->NewStringFromAscii(i::CStrVector(error));
+ }
+ return result;
+}
+
+
#ifdef DEBUG
bool Context::IsBootstrappingOrValidParentContext(
Object* object, Context* child) {
« no previous file with comments | « src/contexts.h ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698