Skip to content

Commit

Permalink
#881 remove error "JavaScript attribute can only be used on a quotati…
Browse files Browse the repository at this point in the history
…on argument."
  • Loading branch information
Jand42 committed Jan 8, 2018
1 parent 6ad76dc commit 2166759
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/compiler/WebSharper.Compiler.FSharp/CodeReader.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,16 +1131,13 @@ let scanExpression (env: Environment) (containingMethodName: string) (expr: FSha
| Some x ->
x |> Array.iter (fun i ->
let arg = arguments.[i]
let err() =
env.Compilation.AddError(Some arg.Range.AsSourcePos,
CompilationError.SourceError "JavaScript attribute can only be used on a quotation argument.")
match arg with
| P.Quote e -> Some e
| P.Value v ->
match vars.TryGetValue v with
| true, e -> Some e
| false, _ -> err(); None
| _ -> err(); None
| false, _ -> None
| _ -> None
|> Option.iter (fun e ->
let pos = e.Range.AsSourcePos
let e = transformExpression env e
Expand Down

0 comments on commit 2166759

Please sign in to comment.