@@ -233,7 +233,7 @@ class Value : public std::enable_shared_from_this<Value> {
233233 }
234234 } else if (is_object ()) {
235235 if (!index.is_hashable ())
236- throw std::runtime_error (" Unashable type: " + index.dump ());
236+ throw std::runtime_error (" Unhashable type: " + index.dump ());
237237 auto it = object_->find (index.primitive_ );
238238 if (it == object_->end ())
239239 throw std::runtime_error (" Key not found: " + index.dump ());
@@ -252,7 +252,7 @@ class Value : public std::enable_shared_from_this<Value> {
252252 auto index = key.get <int >();
253253 return array_->at (index < 0 ? array_->size () + index : index);
254254 } else if (object_) {
255- if (!key.is_hashable ()) throw std::runtime_error (" Unashable type: " + dump ());
255+ if (!key.is_hashable ()) throw std::runtime_error (" Unhashable type: " + dump ());
256256 auto it = object_->find (key.primitive_ );
257257 if (it == object_->end ()) return Value ();
258258 return it->second ;
@@ -261,7 +261,7 @@ class Value : public std::enable_shared_from_this<Value> {
261261 }
262262 void set (const Value& key, const Value& value) {
263263 if (!object_) throw std::runtime_error (" Value is not an object: " + dump ());
264- if (!key.is_hashable ()) throw std::runtime_error (" Unashable type: " + dump ());
264+ if (!key.is_hashable ()) throw std::runtime_error (" Unhashable type: " + dump ());
265265 (*object_)[key.primitive_ ] = value;
266266 }
267267 Value call (const std::shared_ptr<Context> & context, ArgumentsValue & args) const {
@@ -398,7 +398,7 @@ class Value : public std::enable_shared_from_this<Value> {
398398 }
399399 return false ;
400400 } else if (object_) {
401- if (!value.is_hashable ()) throw std::runtime_error (" Unashable type: " + value.dump ());
401+ if (!value.is_hashable ()) throw std::runtime_error (" Unhashable type: " + value.dump ());
402402 return object_->find (value.primitive_ ) != object_->end ();
403403 } else {
404404 throw std::runtime_error (" contains can only be called on arrays and objects: " + dump ());
@@ -416,7 +416,7 @@ class Value : public std::enable_shared_from_this<Value> {
416416 return const_cast <Value*>(this )->at (index);
417417 }
418418 Value& at (const Value & index) {
419- if (!index.is_hashable ()) throw std::runtime_error (" Unashable type: " + dump ());
419+ if (!index.is_hashable ()) throw std::runtime_error (" Unhashable type: " + dump ());
420420 if (is_array ()) return array_->at (index.get <int >());
421421 if (is_object ()) return object_->at (index.primitive_ );
422422 throw std::runtime_error (" Value is not an array or object: " + dump ());
0 commit comments