You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Sylwester Lachiewicz (Jira)" <ji...@apache.org> on 2026/09/21 20:42:00 UTC
[jira] [Created] (THRIFT-6336) JavaScript generator renders a uuid constant as the address of its t_const_value
Sylwester Lachiewicz created THRIFT-6336:
--------------------------------------------
Summary: 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
{{--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)