jiahuili430 commented on code in PR #5364:
URL: https://github.com/apache/couchdb/pull/5364#discussion_r1895884319
##########
share/server/util.js:
##########
@@ -116,7 +116,14 @@ var Couch = {
"Expression does not eval to a function. (" + source.toString() +
")"]);
};
},
- recursivelySeal : deepFreeze
+ recursivelySeal: function (obj) {
Review Comment:
Tried the following 2 methods but get same errors in `chttpd_view_test` when
using `SpiderMonkey 1.8.5`.
```diff
recursivelySeal: function (obj) {
- seal(obj);
+ deepFreeze(obj);
for (var propname in obj) {
if (typeof obj[propname] == "object") {
arguments.callee(obj[propname]);
}
}
},
```
```diff
+ recursivelySeal: deepFreeze
};
...
function deepFreeze(object) {
...
// Freeze properties before freezing self
for (var i in propNames) {
const value = object[propNames[i]];
- if ((value && typeof value === "object") || typeof value ===
"function") {
+ if (value && typeof value == "object") {
deepFreeze(value);
}
}
}
```
Error message:
```
[2024-12-23T15:18:42.050Z] module 'chttpd_view_test'
[2024-12-23T15:18:42.050Z] chttpd view tests
[2024-12-23T15:18:45.302Z] chttpd_view_test:74: -view_test_/0-fun-30-
(t_view_with_queries_keys)...*failed*
[2024-12-23T15:18:45.302Z] in function
chttpd_view_test:t_view_with_queries_keys/1 (test/eunit/chttpd_view_test.erl,
line 132)
[2024-12-23T15:18:45.302Z] in call from eunit_test:run_testfun/1
(eunit_test.erl, line 71)
[2024-12-23T15:18:45.302Z] in call from eunit_proc:run_test/1
(eunit_proc.erl, line 543)
[2024-12-23T15:18:45.302Z] in call from eunit_proc:with_timeout/3
(eunit_proc.erl, line 368)
[2024-12-23T15:18:45.302Z] in call from eunit_proc:handle_test/2
(eunit_proc.erl, line 526)
[2024-12-23T15:18:45.302Z] in call from eunit_proc:tests_inorder/3
(eunit_proc.erl, line 468)
[2024-12-23T15:18:45.302Z] in call from eunit_proc:with_timeout/3
(eunit_proc.erl, line 358)
[2024-12-23T15:18:45.302Z] in call from eunit_proc:run_group/2
(eunit_proc.erl, line 582)
[2024-12-23T15:18:45.302Z] **error:{assertMatch,[{module,chttpd_view_test},
[2024-12-23T15:18:45.302Z] {line,132},
[2024-12-23T15:18:45.302Z] {expression,"Res"},
[2024-12-23T15:18:45.302Z] {pattern,"# { << \"results\" >> :=
[ # { << \"total_rows\" >> := 3 , << \"offset\" >> := 1 , << \"rows\" >> := [ #
{ << \"id\" >> := << \"a\" >> } , # { << \"id\" >> := << \"c\" >> } ] } ] }"},
[2024-12-23T15:18:45.302Z] {value,#{<<"error">> =>
<<"ReferenceError">>,
[2024-12-23T15:18:45.302Z] <<"reason">> =>
[2024-12-23T15:18:45.302Z]
<<"{[{<<\"message\">>,<<\"Reflect is not d"...>>}}]}
[2024-12-23T15:18:45.302Z] output:<<"">>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]