summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: [JS] support closures in container literals.Daniel Jasper2014-05-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Before: return {body: {setAttribute: function(key, val) {this[key] = val; } , getAttribute : function(key) { return this[key]; } , style : { direction: '' } } } ; After: return { body: { setAttribute: function(key, val) { this[key] = val; }, getAttribute: function(key) { return this[key]; }, style: {direction: ''} } }; llvm-svn: 208292
* clang-format: [JS] Support regex literals after 'return'.Daniel Jasper2014-05-081-0/+2
| | | | llvm-svn: 208285
* clang-format: [JS] Initial support for regex literals.Daniel Jasper2014-05-081-0/+70
| | | | llvm-svn: 208281
* clang-format: Be slightly more aggressive on single-line functions.Daniel Jasper2014-05-071-0/+5
| | | | | | | | | | | | | | So that JS functions can also be merged into a single line. Before: var func = function() { return 1; }; After: var func = function() { return 1; }; llvm-svn: 208176
* clang-format: [JS] Keep space after closure style comments.Daniel Jasper2014-05-061-0/+4
| | | | | | | | | | Before: var x = /** @type {foo} */ (bar); After: var x = /** @type {foo} */(bar); llvm-svn: 208093
* clang-format: [JS] Keep space between 'return' and '['.Daniel Jasper2014-05-061-0/+4
| | | | llvm-svn: 208090
* clang-format: [JS] Don't indent in goog.scope blocks.Daniel Jasper2014-05-061-0/+7
| | | | | | | | | | | | | | | | Before: goog.scope(function() { var x = a.b; var y = c.d; }); // goog.scope After: goog.scope(function() { var x = a.b; var y = c.d; }); // goog.scope llvm-svn: 208088
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-2/+2
| | | | | | | | | | definition below all of the header #include lines, clang edition. If you want more details about this, you can see some of the commits to Debug.h in LLVM recently. This is just the clang section of a cleanup I've done for all uses of DEBUG_TYPE in LLVM. llvm-svn: 206849
* clang-format: Let chromium style inherit google style's javascript tweaks.Nico Weber2014-02-021-5/+8
| | | | llvm-svn: 200652
* clang-format: (JavaScript) Don't crash on empty string literals.Daniel Jasper2014-01-311-0/+4
| | | | | | | Before, this would lead to a crash: f('', true); llvm-svn: 200540
* clang-format: Fixed formatting of JavaScript container literalsDaniel Jasper2014-01-151-0/+5
| | | | | | | | | | | | Before: var arr = [ 1, 2, 3 ]; var obj = {a : 1, b : 2, c : 3}; After: var arr = [1, 2, 3]; var obj = {a: 1, b: 2, c: 3}; llvm-svn: 199317
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+0
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Allow predefined styles to define different options for different languages.Alexander Kornienko2013-12-101-16/+14
| | | | | | | | | | | | | | | | | | | | | | | Summary: Allow predefined styles to define different options for different languages so that one can run: clang-format -style=google file1.cpp file2.js or use a single .clang-format file with "BasedOnStyle: Google" for both c++ and JS files. Added Google style for JavaScript with "BreakBeforeTernaryOperators" set to false. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2364 llvm-svn: 196909
* Create a separate file for JS-specific unit tests.Alexander Kornienko2013-12-031-0/+86
Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2307 llvm-svn: 196266
OpenPOWER on IntegriCloud