scriptsharp icon indicating copy to clipboard operation
scriptsharp copied to clipboard

Script.Literal breaks JS Compilation in ObjectNotation with params

Open andekande opened this issue 12 years ago • 1 comments

works: Script.Literal("alert({greet: 'Hello'}.greet)");

breaks: string s = "Hello"; Script.Literal("alert({greet: 'Hello'}.greet)", s); Script.Literal("alert({greet: {0}}.greet)", s); In this cases the JS compilation just stops and I get a non executable JavaScript.

andekande avatar Apr 18 '13 08:04 andekande

You should be using {{ and }} in calls where you want { and } and have argument substitution happening (just like String.Format).

We can leave this bug open so it can track the lack of error message in case of bad format strings.

nikhilk avatar Apr 18 '13 12:04 nikhilk