Allow to extract string value from a property with type of property map in JavaScript 25/51225/2
authorRichard Huang <r.huang@samsung.com>
Thu, 5 Nov 2015 11:11:30 +0000 (11:11 +0000)
committerRichard Huang <r.huang@samsung.com>
Thu, 5 Nov 2015 11:13:53 +0000 (03:13 -0800)
Change-Id: I6a59cb84c9c105a0692d1492a7e34f80946b988e

plugins/dali-script-v8/src/object/property-value-wrapper.cpp

index f51884894b67d6d1fdab7de39d6a2605e6b9f75f..b9d7b4c48dccad94a5fc7d3ed363667c71e570f3 100644 (file)
@@ -762,6 +762,13 @@ Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* i
         Dali::Property::Map propertyMap = V8Utils::GetPropertyMapFromObject(isolate, object);
         daliPropertyValue = Dali::Property::Value( propertyMap );
       }
+      else if( V8Utils::IsStringPrimitiveOrObject( v8Value) )
+      {
+        // There are special cases where a property with property map type can accept a string value,
+        // so we do the additional check here.
+        daliPropertyValue = Dali::Property::Value( V8Utils::GetStringValue( isolate, v8Value) );
+      }
+
       break;
     }
     case Dali::Property::NONE:
@@ -769,9 +776,9 @@ Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* i
     {
       break;
     }
-   } // switch type
+  } // switch type
 
-   return daliPropertyValue;
+  return daliPropertyValue;
 }
 
 void PropertyValueWrapper::NewRotation( const v8::FunctionCallbackInfo< v8::Value >& args)