[SERVER-7892] JS (v8) doesn't indent Created: 10/Dec/12 Updated: 11/Jul/16 Resolved: 18/Mar/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript, Shell |
| Affects Version/s: | 2.3.1 |
| Fix Version/s: | 2.4.4, 2.5.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | Tad Marshall |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
If you do
The output is not indented. This worked with spidermonkey |
| Comments |
| Comment by auto [ 30/Apr/13 ] |
|
Author: {u'date': u'2013-03-18T17:14:06Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}Message: V8 displays source code "as-is", so if we remove indentation then it |
| Comment by auto [ 18/Mar/13 ] |
|
Author: {u'date': u'2013-03-18T17:14:06Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}Message: V8 displays source code "as-is", so if we remove indentation then it |
| Comment by Tad Marshall [ 23/Dec/12 ] |
|
What is happening here is that V8 just prints the JavaScript exactly as it was provided to it, and our jsToH Python script strips leading spaces and tabs from the JavaScript code we supply. We could either stop stripping spaces and tabs or add code to do pretty-printing of JavaScript. Code that is supplied that includes indentation will be displayed as-is with its indentation. |