[
https://issues.apache.org/jira/browse/THRIFT-6336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Geyer resolved THRIFT-6336.
--------------------------------
Fix Version/s: 0.26.0
Assignee: Sylwester Lachiewicz
Resolution: Fixed
> JavaScript generator renders a uuid constant as the address of its
> t_const_value
> --------------------------------------------------------------------------------
>
> Key: THRIFT-6336
> URL: https://issues.apache.org/jira/browse/THRIFT-6336
> Project: Thrift
> Issue Type: Bug
> Components: JavaScript - Compiler
> Affects Versions: 0.25.0
> Reporter: Sylwester Lachiewicz
> Assignee: Sylwester Lachiewicz
> Priority: Minor
> Fix For: 0.26.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {{--gen js}} writes the pointer, not the string, for a constant of type
> {{uuid}}. The {{TYPE_UUID}} case of
> [t_js_generator.cc:822|https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_js_generator.cc#L822]
> streams the {{t_const_value*}} itself; the string case just above it streams
> {{get_escaped_string(value)}}.
> {code}
> const uuid GEN_UUID = "00000000-1111-2222-3333-444444444444"
> {code}
> {noformat}
> $ thrift --gen js repro.thrift && grep GEN_UUID gen-js/repro_types.js
> GEN_UUID = '0x103c17a50';
> $ thrift --gen js repro.thrift && grep GEN_UUID gen-js/repro_types.js
> GEN_UUID = '0x10196ba50';
> {noformat}
> The value differs from run to run. {{test/ConstantsDemo.thrift}} in the
> repository has such a constant, so the cross-test generates it on every
> build. Reproduced on master at 3af0cfff1.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)