Skip to content

Commit e72133d

Browse files
authored
Merge pull request #132 from tedious/private_methods
Support private methods
2 parents aa786b1 + bab7c39 commit e72133d

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

src/JShrink/Minifier.php

+1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ protected function initialize($js, $options)
201201
'-' => true,
202202
'+' => true,
203203
'[' => true,
204+
'#' => true,
204205
'@' => true];
205206

206207

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export default class Example {
2+
#prop
3+
4+
set prop (value) {
5+
this.#prop = value
6+
7+
this.#event(value)
8+
}
9+
get prop () {
10+
return this.#prop
11+
}
12+
13+
constructor (arg) {
14+
this.#prop = arg
15+
16+
if (arg) {
17+
this.#method()
18+
}
19+
}
20+
21+
#event = f => {
22+
if (typeof f === 'function') {
23+
f()
24+
}
25+
}
26+
27+
#method = async _ => {
28+
return fetch(param)
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default class Example{#prop
2+
set prop(value){this.#prop=value
3+
this.#event(value)}
4+
get prop(){return this.#prop}
5+
constructor(arg){this.#prop=arg
6+
if(arg){this.#method()}}
7+
#event=f=>{if(typeof f==='function'){f()}}
8+
#method=async _=>{return fetch(param)}}

0 commit comments

Comments
 (0)