[SERVER-6732] V8 Scripting: Multiline JSON Arrays break using square brackets alone Created: 08/Aug/12 Updated: 15/Aug/12 Resolved: 08/Aug/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.0.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Dan Dart | Assignee: | Tad Marshall |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OSX |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
Whereas usually you can start typing an object, e.g.:
the same breaks when you try to do so with an array - with the square bracket on its own.
It works when there's something after the square bracket, e,g.:
or:
And fails when the remainder is concluded without the square bracket on the same line:
This only happens on the top level, as demonstrated using a nested array:
I think this is to do with the V8 engine but don't really know. |
| Comments |
| Comment by Dan Dart [ 08/Aug/12 ] | |
|
Thanks for the clear-up. | |
| Comment by Tad Marshall [ 08/Aug/12 ] | |
|
Thanks for the report. Yes, the code for entering and staying in multi-line mode wasn't checking for square braces the way it does for parentheses and wavy braces. This was just fixed for 2.2.0-rc1 in Your third case,
works because of the dangling comma. The bug is not related to V8. The multi-line mode is something that the shell does before it passes JavaScript to the JavaScript engine (SpiderMonkey or V8, depending on which build you run). | |
| Comment by Dan Dart [ 08/Aug/12 ] | |
|
Jira appears to have fiddled line endings... |