Permalink
Browse files

Only emit default values with double quotes if the top level entity i…

…s a regular string

Summary: Only emit default values with double quotes if the top level entity is a regular string

Reviewed By: vladima

Differential Revision: D6848706

fbshipit-source-id: 8670112a1b9e48f04389a01cf0fabd19cf249dc2
  • Loading branch information...
oulgen authored and hhvm-bot committed Jan 30, 2018
1 parent 7af4146 commit 4bd14080fae739487533ef988e47bcbf7bc15ba2
Showing with 3 additions and 1 deletion.
  1. +3 −1 hphp/hack/src/hhbc/hhbc_hhas.ml
@@ -1229,7 +1229,9 @@ and string_of_param_default_value ~env expr =
let string_of_param_default_value_option env = function
| None -> ""
| Some (label, expr) ->
let env = { codegen_env = env; use_single_quote = false } in
let use_single_quote =
match snd expr with A.String _ -> false | _ -> true in
let env = { codegen_env = env; use_single_quote } in
" = "
^ (string_of_label label)
^ "(\"\"\""

0 comments on commit 4bd1408

Please sign in to comment.