Skip to content

Commit 0fd4727

Browse files
authored
Merge pull request #1362 from NativeScript/trifonov/smart-stringify-improve
added const to avoid using `seen` as global
2 parents 7c2ae2e + 9b86c91 commit 0fd4727

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test-app/runtime/src/main/cpp/V8GlobalHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Local<Function> GetSmartJSONStringifyFunction(Isolate* isolate) {
2222
string smartStringifyFunctionScript =
2323
"(function () {\n"
2424
" function smartStringify(object) {\n"
25-
" seen = [];\n"
25+
" const seen = [];\n"
2626
" var replacer = function (key, value) {\n"
2727
" if (value != null && typeof value == \"object\") {\n"
2828
" if (seen.indexOf(value) >= 0) {\n"

0 commit comments

Comments
 (0)