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 241963 - Navigator type casting is wrong or incomplete
Summary: Navigator type casting is wrong or incomplete
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-16 20:51 UTC by c69
Modified: 2014-07-25 02:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description c69 2014-02-16 20:51:48 UTC
This issue is a spriritual succesor to 222893 and a sibling to 234453.

When we can decide the type in static (and we can, thanks to ASM.JS findings) - why dont we use this information ?

In some cases - it works fine (see: ok() function), but in some cases its just plain crazy (see print() or a())


/**
 * Expected: Boolean
 * Actual: Number.x
 * @param {string} x
 */
function a(x) {
        return !!x;
}

/**
 * Expected: Number
 * Actual: String
 * @param {string} y
 */
function b(y) {
        return +y;
}

/**
 * Expected: Number
 * Actual: Number|String
 * @param {string} z
 */
function c(z) {
        return z|0;
}

/**
 * Expected: String
 * Actual: String
 * @param {number} n
 */
function ok(n) {
        return ''+n;
}

/**
 * Expected: String
 * Actual: String|window.print.value
 * @param {string} value
  */
function print(value) {
        return value;
}
Comment 1 Vladimir Riha 2014-02-17 07:52:20 UTC
Reproducible

Product Version: NetBeans IDE Dev (Build 201402160001)
Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b69
Runtime: Java(TM) SE Runtime Environment 1.8.0-b129
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 2 Petr Pisl 2014-07-23 13:00:43 UTC
I have fixed all the cases, except the last one. It's caused by something different that the previous cases. I have created new issue #245916. Marking this issue as fixed.
Comment 3 Quality Engineering 2014-07-25 02:37:04 UTC
Integrated into 'main-silver', will be available in build *201407250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0753d9de88b9
User: Petr Pisl <ppisl@netbeans.org>
Log: #241963 - Navigator type casting is wrong or incomplete