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 Jan 24, 2012 2:05:08 PM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
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>