PreviewWidget.add_widget( widget ) throws "Error: expected an exported object"

Bug #1524542 reported by matthew
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-js-scopes
Fix Committed
High
Marcus Tomlinson

Bug Description

Calls to add_widget on expandable PreviewWidgets throws "Error: expected an exported object" (v8-cpp/src/convert.h line: 521) for every widget passed as an argument.

Code:
    var ingredients = new scopes.lib.PreviewWidget("ingredients", "expandable");
    ingredients.add_attribute_value("title", "Ingredients");
    ingredients.add_attribute_value("collapsed-widgets", 0);

    try
    {
        for (var i in ingredientsList)
        {
            var temp = new scopes.lib.PreviewWidget("temp", "text");
            temp.add_attribute_value("text", ingredientsList[i]);

            ingredients.add_widget (temp);
         }
     }
     catch (e)
     {
         console.log(e.name);
         console.log(e.message);
         console.log(e.stack);
     }

Result:
    Error
    expected an exported object
    Error: expected an exported object
        at Error (native)
        at null.<anonymous> (/home/build-my-scope-Ubuntu_SDK_Desktop_Kit-Default/src/my-scope.my-user-id_my-scope.js:203:57)

Related branches

matthew (matthew1006)
summary: - add_widget method throws "Error: expected an exported object"
+ PreviewWidget.add_widget( widget ) throws "Error: expected an exported
+ object"
Changed in unity-js-scopes:
assignee: nobody → Marcus Tomlinson (marcustomlinson)
importance: Undecided → High
status: New → In Progress
Changed in unity-js-scopes:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.