Index: samples/process.cc |
diff --git a/samples/process.cc b/samples/process.cc |
index 4db7eeb7b87c426f1efd8f39a54fe1b1b2993600..b0663925dcbb96ab20c72dd00086a30572736911 100644 |
--- a/samples/process.cc |
+++ b/samples/process.cc |
@@ -116,9 +116,9 @@ class JsHttpRequestProcessor : public HttpRequestProcessor { |
const PropertyCallbackInfo<Value>& info); |
// Callbacks that access maps |
- static void MapGet(Local<String> name, |
+ static void MapGet(Local<Name> name, |
const PropertyCallbackInfo<Value>& info); |
- static void MapSet(Local<String> name, |
+ static void MapSet(Local<Name> name, |
Local<Value> value, |
const PropertyCallbackInfo<Value>& info); |
@@ -359,13 +359,15 @@ string ObjectToString(Local<Value> value) { |
} |
-void JsHttpRequestProcessor::MapGet(Local<String> name, |
+void JsHttpRequestProcessor::MapGet(Local<Name> name, |
const PropertyCallbackInfo<Value>& info) { |
+ if (name->IsSymbol()) return; |
+ |
// Fetch the map wrapped by this object. |
map<string, string>* obj = UnwrapMap(info.Holder()); |
// Convert the JavaScript string to a std::string. |
- string key = ObjectToString(name); |
+ string key = ObjectToString(Local<String>::Cast(name)); |
// Look up the value if it exists using the standard STL ideom. |
map<string, string>::iterator iter = obj->find(key); |
@@ -381,14 +383,16 @@ void JsHttpRequestProcessor::MapGet(Local<String> name, |
} |
-void JsHttpRequestProcessor::MapSet(Local<String> name, |
+void JsHttpRequestProcessor::MapSet(Local<Name> name, |
Local<Value> value_obj, |
const PropertyCallbackInfo<Value>& info) { |
+ if (name->IsSymbol()) return; |
+ |
// Fetch the map wrapped by this object. |
map<string, string>* obj = UnwrapMap(info.Holder()); |
// Convert the key and value to std::strings. |
- string key = ObjectToString(name); |
+ string key = ObjectToString(Local<String>::Cast(name)); |
string value = ObjectToString(value_obj); |
// Update the map. |