Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-287956: : (colon) expected when mixing if statements in script tags

$
0
0
Reporter Naz Junaid (naz) Naz Junaid (naz)
Created Jan 24, 2012 1:56:31 PM
Updated Apr 26, 2012 9:39:46 PM
Priority Show-stopper
Type Bug
Fix versions 7.0
State Submitted
Assignee Dmitry Osinovsky (Dmitry.Osinovsky)
Subsystem JavaScript
Affected versions 6.1.1
Fixed in build No Fixed in build
ReSharper isn't happy with the following code

    <script>
        var myObj = {
            item1: @Model.MyItem1,
            item2: @Model.MyItem2,
            @if (Model.MyItem3 != null)
            {
                @:item3: @Model.MyItem3,
            }
            item4: @Model.MyItem4
        }
    </script>


It highlights item4 and suggests a colon is required.

It appears the if statement above trips up the parser.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>