unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob fc39c122441dd7c82554f3cf9732c063b3469a0e 1746 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
 
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/
)

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

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

debug log:

solving fc39c12244 ...
found fc39c12244 in https://yhetil.org/emacs-bugs/1195338258.64458.1549836224184@privateemail.com/
found b0d8bcabd2 in https://git.savannah.gnu.org/cgit/emacs.git
preparing index
index prepared:
100644 b0d8bcabd203f222144ff157ae658a817781360b	test/manual/indent/js.js

applying [1/1] https://yhetil.org/emacs-bugs/1195338258.64458.1549836224184@privateemail.com/
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index b0d8bcabd2..fc39c12244 100644

Checking patch test/manual/indent/js.js...
Applied patch test/manual/indent/js.js cleanly.

index at:
100644 fc39c122441dd7c82554f3cf9732c063b3469a0e	test/manual/indent/js.js

(*) 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).