unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 9658c95701cebe4c7764970eb32bb4d8b5b224b2 1918 bytes (raw)
name: test/manual/indent/js.js 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
 
var a = 1;
b = 2;

let c = 1,
    d = 2;

var e = 100500,
    + 1;

// Don't misinterpret "const"
/const/

function test ()
{
  return /[/]/.test ('/')     // (bug#19397)
}

var f = bar('/protocols/')
baz();

var h = 100500
1;

const i = 1,
      j = 2;

var k = 1,
    l = [
      1, 2,
      3, 4
    ],
    m = 5;

var n = function() {
  return 7;
},
    o = 8;

foo(bar, function() {
  return 2;
});

switch (b) {
case "a":
  2;
default:
  3;
}

var p = {
  case: 'zzzz',
  default: 'donkey',
  tee: 'ornery'
};

var evens = [e for each (e in range(0, 21))
               if (ed % 2 == 0)];

var funs = [
  function() {
    for (;;) {
    }
  },
  function(){},
];

!b
  !=b
  !==b

a++
b +=
  c

var re = /some value/
str.match(re)

baz(`http://foo.bar/${tee}`)
  .qux();

`multiline string
       contents
  are kept
        unchanged!`

class A {
  * x() {
    return 1
      * a(2);
  }

  *[Symbol.iterator]() {
    yield "Foo";
    yield "Bar";
  }
}

if (true)
  1
else
  2

Foobar
  .find()
  .catch((err) => {
    return 2;
  })
  .then((num) => {
    console.log(num);
  });

var z = [
  ...iterableObj,
  4,
  5
]

var arr = [
  -1, 2,
  -3, 4 +
    -5
];

// Regression test for bug#15582.
if (x > 72 &&
    y < 85) { // found
  do_something();
}

// Test that chaining doesn't happen when js-chain-indent is nil.
let x = svg.mumble()
    .zzz;

// https://github.com/mooz/js2-mode/issues/405
if (1) {
  isSet
    ? (isEmpty ? 2 : 3)
    : 4
}

// Regexp is not a continuation
bar(
  "string arg1",
  /abc/
)

// No infloop inside js--re-search-backward-inner
let b = {
  a : `
  //1
  `
}

// bug#25904
foo.bar.baz(very => // A comment
  very
).biz(([baz={a: [123]}, boz]) =>
  baz
).snarf((snorf) => /* Another comment */
  snorf
);

// Continuation of bug#25904; support broken arrow as N+1th arg
map(arr, (val) =>
  val
)

// Local Variables:
// indent-tabs-mode: nil
// js-indent-level: 2
// End:

debug log:

solving 9658c95701 ...
found 9658c95701 in https://git.savannah.gnu.org/cgit/emacs.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).