Fix Javascript generator to use %renamed variable names.
This commit is contained in:
parent
108143951d
commit
b6c9c97b96
2 changed files with 12 additions and 2 deletions
|
|
@ -44,7 +44,6 @@ CPP_TEST_CASES = \
|
||||||
cpp_static \
|
cpp_static \
|
||||||
director_alternating \
|
director_alternating \
|
||||||
enum_template \
|
enum_template \
|
||||||
infinity \
|
|
||||||
namespace_virtual_method \
|
namespace_virtual_method \
|
||||||
overload_copy \
|
overload_copy \
|
||||||
rename1 \
|
rename1 \
|
||||||
|
|
@ -68,6 +67,7 @@ CPP_TEST_CASES = \
|
||||||
javascript_unicode
|
javascript_unicode
|
||||||
|
|
||||||
BROKEN_TEST_CASES = \
|
BROKEN_TEST_CASES = \
|
||||||
|
infinity \
|
||||||
preproc_include
|
preproc_include
|
||||||
|
|
||||||
SKIP_CPP_CASES = @SKIP_CPP_CASES@
|
SKIP_CPP_CASES = @SKIP_CPP_CASES@
|
||||||
|
|
|
||||||
|
|
@ -793,8 +793,18 @@ int JSEmitter::enterFunction(Node *n) {
|
||||||
|
|
||||||
int JSEmitter::enterVariable(Node *n) {
|
int JSEmitter::enterVariable(Node *n) {
|
||||||
|
|
||||||
|
// reset the state information for variables.
|
||||||
state.variable(true);
|
state.variable(true);
|
||||||
state.variable(NAME, Swig_scopename_last(Getattr(n, "name")));
|
|
||||||
|
// Retrieve a pure symbol name. Using 'sym:name' as a basis, as it considers %renamings.
|
||||||
|
|
||||||
|
if (Equal(Getattr(n, "view"), "memberconstantHandler")) {
|
||||||
|
// Note: this is kind of hacky/experimental
|
||||||
|
// For constants/enums 'sym:name' contains e.g., 'Foo_Hello' instead of 'Hello'
|
||||||
|
state.variable(NAME, Getattr(n, "memberconstantHandler:sym:name"));
|
||||||
|
} else {
|
||||||
|
state.variable(NAME, Swig_scopename_last(Getattr(n, "sym:name")));
|
||||||
|
}
|
||||||
|
|
||||||
if(Equal(Getattr(n, "storage"), "static")) {
|
if(Equal(Getattr(n, "storage"), "static")) {
|
||||||
SetFlag(state.variable(), IS_STATIC);
|
SetFlag(state.variable(), IS_STATIC);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue