This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267737 - Running a simple knockout application crashes NetBeans when using the embedded browser
Summary: Running a simple knockout application crashes NetBeans when using the embedde...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Embedded Browser (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-28 12:48 UTC by markiewb
Modified: 2016-12-05 14:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example project (263.44 KB, application/octet-stream)
2016-08-28 12:48 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2016-08-28 12:48:23 UTC
Created attachment 161793 [details]
Example project

Run the attached application in the embedded browser.

In index.html there is a data-binding with logic
<p data-bind="visible: userName()=='Admin'">You are an admin.</p>

When you run this application (see attachment) NB will shutdown without any log entry. It has to do something with the embedded browser. Other browsers work.

Happens in 8.1 and Dev
Comment 1 markiewb 2016-08-28 12:53:57 UTC
It works, when the name matches exactly the variable name. userName vs username

A simple typo should not crash the embedded browser/NB.

Working:

<p data-bind="visible: username()=='Admin'">You are an admin.</p>
...
define(['knockout'], function (ko) {
    return function THISWASMISSING(defaultValue) {
        this.username = ko.observable(defaultValue);
        this.greeting = ko.pureComputed(function () {
            return 'Hello' + this.username().toUpperCase();
        }, this);
        this.isAdmin = ko.pureComputed(function () {
            return this.username() === "Admin";
        }, this);
    };
});

Non working (crashing):

<p data-bind="visible: userName()=='Admin'">You are an admin.</p>
...
define(['knockout'], function (ko) {
    return function THISWASMISSING(defaultValue) {
        this.username = ko.observable(defaultValue);
        this.greeting = ko.pureComputed(function () {
            return 'Hello' + this.username().toUpperCase();
        }, this);
        this.isAdmin = ko.pureComputed(function () {
            return this.username() === "Admin";
        }, this);
    };
});