[Tool][Generator] Add validation to constructor function in JS and remove native...
authorPawel Kaczmarek <p.kaczmarek3@samsung.com>
Wed, 28 Jan 2015 12:42:18 +0000 (13:42 +0100)
committerPawel Kaczmarek <p.kaczmarek3@samsung.com>
Wed, 28 Jan 2015 12:42:18 +0000 (13:42 +0100)
[Verification]
Each constructor in JS should have validation
Should not generate native call in JS and c++

Change-Id: If4895868b5e61a4c4155edc746a7e7cec8c9208d
Signed-off-by: Pawel Kaczmarek <p.kaczmarek3@samsung.com>
tools/skeleton_generator/WAPIOven.py
tools/skeleton_generator/tpl/tpl_api.js

index 3c204dc9206a347c7672a5119a6dc34c65f54b59..31c4f52b14d82751a874426625fcbba9cc361f9d 100644 (file)
@@ -173,12 +173,6 @@ class Compiler(IndentPrintable):
                                         if child.name == attr.name:
                                             attr.existIn = x.name + "." + child.name
                                     break
-                    if len([x for x in attributes if not hasattr(x, "existIn")]) > 0:
-                        native_function = iface.name + "Constructor"
-                        native_cmd = iface.name + "_constructor"
-                        self.ctx['cmdtable'][native_function] = native_cmd
-                        iface.native_function = native_function
-                        iface.native_cmd = native_cmd
                 if iface.inherit in [x.name for x in self.ctx['exportedInterface']]:
                     iface.private = True
                 #if iface.name in self.ctx['callback']:
index e75425c16d1e1cf5eb2b9ece4a66344069995794..88de9529014a60bb01fb5febdb200c62f914c012 100644 (file)
@@ -86,15 +86,7 @@ function {{iface.name}}(
     {%- endfor -%}
     {%- endif -%}) {
   // constructor of {{iface.name}}
-  {% if iface.constructor %}
-  var nativeParam = {
-    {% for arg in iface.constructor.primitiveArgs %}
-    '{{arg.name}}': args.{{arg.name}}{% if not loop.last %},{% endif %}
-
-    {% endfor %}
-  };
-  var syncResult = callNative('{{iface.name}}_constructor', nativeParam);
-  {% endif %}
+  validator_.isConstructorCall(this, {{iface.name}});
 
   {% for attribute in iface.getTypes('Attribute') %}
     {% if attribute.existIn == 'ctor' %}