]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[fdxhook] Added flags
authorFrancis Dupont <fdupont@isc.org>
Mon, 27 Jun 2016 19:28:41 +0000 (21:28 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 27 Jun 2016 19:28:41 +0000 (21:28 +0200)
src/hooks/external/v8/dso.cc
src/hooks/external/v8/tests.cc

index ef8212bf761cbb85bf11b5f92047714608353536..cbf06d87d883e6a63d6ca7cb9e234d3b46579248 100644 (file)
@@ -131,6 +131,13 @@ int load(LibraryHandle& handle) {
     isolate_ = Isolate::New(create_params);
     isolate_->SetFatalErrorHandler(&fatal_error_handler);
 
+    // Get flags
+    ConstElementPtr flags = handle.getParameter("flags");
+    if (flags && flags->getType() == Element::string) {
+        string flgs = flags->stringValue();
+        V8::SetFlagsFromString(flgs.c_str(), static_cast<int>(flgs.size()));
+    }
+
     // Open a scope for the script
     Isolate::Scope isolate_scope(isolate_);
 
index c3772f25465a7d0b5af839cacdfe1a71caf212d8..cdd15f03b72a2a5bfab5d0f783a2c40dd1e1ba34 100644 (file)
@@ -29,7 +29,8 @@ const string config =
     " { \"library\": \"kea.so\", "
     "   \"parameters\": "
     "   { \"program\": \"kea\", "
-    "     \"script\": \"hook.js\" }"
+    "     \"script\": \"hook.js\","
+    "     \"flags\": \"--use_strict\" }"
     " }] }";
 
 // main routine