Example #1
0
dmz::Handle
dmz::JsExtV8Archive::_to_handle (V8Value value) {

   Handle result (_defaultArchive);

   if (value.IsEmpty () == false) {

      if (value->IsNumber ()) { result = v8_to_handle (value); }
      else if (value->IsString ()) {

         result = _defs.create_named_handle (v8_to_string (value));
      }
   }

   return result;
}
Example #2
0
dmz::Handle
dmz::JsExtV8Input::_to_handle (V8Value value) {

   v8::HandleScope scope;

   Handle result (0);

   if (value.IsEmpty () == false) {

      if (value->IsString ()) {

         result = _defs.create_named_handle (*(v8::String::AsciiValue (value)));
      }
      else if (value->IsNumber ()) {

         result = value->Uint32Value ();
      }
   }

   return result;
}