Commit 94a1819c authored by Sam Saccone's avatar Sam Saccone Committed by Paul Yang

Remove unused f expression from jscode gen. (#5573)

Varadic assignment in javascript where the right hand expression is an
object yields a single set assignment with the right most lefthand variable,
while leaving the other left side expressions undefined.

For example:
var a,b = {}

will only initialize a to undefined. But will set b to the {} value.

--

For this code since f is never used, it is a safe operation to remove
it.
parent a2a0afb5
......@@ -2272,7 +2272,7 @@ void Generator::GenerateClassToObject(const GeneratorOptions& options,
" * @suppress {unusedLocalVariables} f is only used for nested messages\n"
" */\n"
"$classname$.toObject = function(includeInstance, msg) {\n"
" var f, obj = {",
" var obj = {",
"classname", GetMessagePath(options, desc));
bool first = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment