diff options
author | dglead <none@none> | 2010-12-28 19:52:20 -0800 |
---|---|---|
committer | dglead <none@none> | 2010-12-28 19:52:20 -0800 |
commit | 27c9f996cfc6a4e8a3e03630588ab68349fe4d17 (patch) | |
tree | d6e4a154fc9cd4b33f338140ac2b4cd6abcf0408 /src | |
parent | 015823fb76b5c4572dd98f29ca13c5e75f911852 (diff) |
prevent strings with C-style comments from breaking helpful comments in generated code
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 5fcb6aa2..4c0b1974 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -161,7 +161,8 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria return makeEmptyStruct(type); } else if (value.text && value.text[0] == '"') { value.text = value.text.substr(1, value.text.length-2); - return JSON.stringify(parseLLVMString(value.text)) + ' /* ' + value.text + '*/'; + return JSON.stringify(parseLLVMString(value.text)) + + ' /* ' + value.text.replace(/\*/g, '_') + ' */'; // make string safe for inclusion in comment } else { // Gets an array of constant items, separated by ',' tokens function handleSegments(tokens) { |