Mercurial > hg > nginx-site
annotate xml/en/docs/njs_about.xml @ 1921:ef3590465d67
Linux packages: updated the list of supported distributions.
author | Konstantin Pavlov <thresh@nginx.com> |
---|---|
date | Tue, 31 Jan 2017 19:43:57 +0300 |
parents | 82ef6dd12534 |
children | 0227aa9b87de |
rev | line source |
---|---|
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
2 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
3 <!-- |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
5 --> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
6 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
7 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
8 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
9 <article name="About nginScript" |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
10 link="/en/docs/njs_about.html" |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
11 lang="en" |
1890
82ef6dd12534
Supported scopes, functions hoisting, cycle "for" with var in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1867
diff
changeset
|
12 rev="5"> |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
13 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
14 <section id="summary"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
15 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
16 <para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
17 nginScript is a subset of the JavaScript language that allows |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
18 implementing location and variable handlers in |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
19 <link doc="http/ngx_http_js_module.xml">http</link> and |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
20 <link doc="stream/ngx_stream_js_module.xml">stream</link>. |
1847 | 21 nginScript is created in compliance with |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
22 <link url="http://www.ecma-international.org/ecma-262/5.1/">ECMAScript 5.1</link> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
23 with some |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
24 <link url="http://www.ecma-international.org/ecma-262/6.0/">ECMAScript 6</link> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
25 extensions. |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
26 The compliance is still evolving. |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
27 </para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
28 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
29 </section> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
30 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
31 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
32 <section id="supported" name="What is currently supported"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
33 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
34 <para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
35 <list type="bullet"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
36 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
37 <listitem> |
1864
543f654ce08a
Fixed phrase about scopes in "About nginScript".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1850
diff
changeset
|
38 Boolean values, numbers, strings, objects, arrays, |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
39 functions, and regular expressions |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
40 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
41 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
42 <listitem> |
1867
e42f6c54ea5f
Added ES7 exponentiation operators support to "About nginScript".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1864
diff
changeset
|
43 ES5.1 operators, ES7 exponentiation operators |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
44 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
45 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
46 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
47 ES5.1 statements: <literal>var</literal>, <literal>if</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
48 <literal>else</literal>, <literal>switch</literal>, <literal>for</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
49 <literal>for in</literal>, <literal>while</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
50 <literal>do while</literal>, <literal>break</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
51 <literal>continue</literal>, <literal>return</literal>, <literal>try</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
52 <literal>catch</literal>, <literal>throw</literal>, <literal>finally</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
53 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
54 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
55 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
56 ES6 <literal>Number</literal> and |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
57 <literal>Math</literal> properties and methods |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
58 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
59 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
60 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
61 <literal>String</literal> methods: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
62 <list type="bullet"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
63 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
64 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
65 ES5.1: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
66 <literal>fromCharCode</literal>, <literal>concat</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
67 <literal>slice</literal>, <literal>substring</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
68 <literal>substr</literal>, <literal>charAt</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
69 <literal>charCodeAt</literal>, <literal>indexOf</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
70 <literal>lastIndexOf</literal>, <literal>toLowerCase</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
71 <literal>toUpperCase</literal>, <literal>trim</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
72 <literal>search</literal>, <literal>match</literal>, <literal>split</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
73 <literal>replace</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
74 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
75 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
76 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
77 ES6: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
78 <literal>fromCodePoint</literal>, <literal>codePointAt</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
79 <literal>includes</literal>, <literal>startsWith</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
80 <literal>endsWith</literal>, <literal>repeat</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
81 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
82 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
83 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
84 non-standard: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
85 <literal>fromUTF8</literal>, <literal>toUTF8</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
86 <literal>fromBytes</literal>, <literal>toBytes</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
87 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
88 </list> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
89 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
90 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
91 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
92 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
93 <literal>Object</literal>: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
94 rudimentary <literal>Object.create()</literal> support without properties list |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
95 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
96 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
97 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
98 <literal>Array</literal> methods: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
99 <list type="bullet"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
100 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
101 ES5.1: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
102 <literal>isArray</literal>, <literal>slice</literal>, <literal>splice</literal>, |
1849
662822812f84
Missed whitespace added. A comma moved to the right place.
Maxim Konovalov <maxim@nginx.com>
parents:
1848
diff
changeset
|
103 <literal>push</literal>, <literal>pop</literal>, <literal>unshift</literal>, |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
104 <literal>shift</literal>, <literal>reverse</literal>, <literal>sort</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
105 <literal>join</literal>, <literal>concat</literal>, <literal>indexOf</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
106 <literal>lastIndexOf</literal>, <literal>forEach</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
107 <literal>some</literal>, <literal>every</literal>, <literal>filter</literal>, |
1848 | 108 <literal>map</literal>, <literal>reduce</literal>, |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
109 <literal>reduceRight</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
110 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
111 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
112 <listitem> |
1850
8eae6bc1ea22
Fixed array.prototype.includes to ES7, corrected grammar.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1849
diff
changeset
|
113 ES7: <literal>includes</literal> |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
114 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
115 </list> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
116 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
117 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
118 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
119 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
120 ES5.1 <literal>Function</literal> methods: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
121 <literal>call</literal>, <literal>apply</literal>, <literal>bind</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
122 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
123 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
124 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
125 ES5.1 <literal>RegExp</literal> methods: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
126 <literal>test</literal>, <literal>exec</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
127 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
128 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
129 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
130 ES5.1 <literal>Date</literal> methods |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
131 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
132 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
133 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
134 ES5.1 global functions: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
135 <literal>isFinite</literal>, <literal>isNaN</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
136 <literal>parseFloat</literal>, <literal>parseInt</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
137 <literal>decodeURI</literal>, <literal>decodeURIComponent</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
138 <literal>encodeURI</literal>, <literal>encodeURIComponent</literal> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
139 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
140 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
141 </list> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
142 </para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
143 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
144 </section> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
145 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
146 |
1850
8eae6bc1ea22
Fixed array.prototype.includes to ES7, corrected grammar.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1849
diff
changeset
|
147 <section id="not_supported" name="What is not supported yet"> |
1846
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
148 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
149 <para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
150 <list type="bullet"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
151 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
152 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
153 ES6 <literal>let</literal> and <literal>const</literal> declarations |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
154 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
155 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
156 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
157 nested functions |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
158 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
159 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
160 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
161 closures |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
162 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
163 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
164 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
165 labels |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
166 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
167 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
168 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
169 <literal>arguments</literal> array |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
170 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
171 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
172 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
173 <literal>eval</literal> function |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
174 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
175 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
176 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
177 <literal>JSON</literal> object |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
178 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
179 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
180 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
181 <literal>Error</literal> object |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
182 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
183 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
184 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
185 <literal>setTimeout</literal>, <literal>setInterval</literal>, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
186 <literal>setImmediate</literal> functions |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
187 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
188 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
189 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
190 non-integer fractions (<literal>.235</literal>), |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
191 exponential (<literal>3.35e10</literal>), |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
192 binary (<literal>0b0101</literal>), |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
193 octal (<literal>0o77</literal>), |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
194 hexadecimal (<literal>0x1123</literal>) literals |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
195 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
196 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
197 </list> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
198 </para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
199 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
200 </section> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
201 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
202 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
203 <section id="install" name="Download and install"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
204 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
205 <para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
206 nginScript is available in two modules: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
207 <list type="bullet"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
208 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
209 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
210 <link doc="http/ngx_http_js_module.xml">ngx_http_js_module</link> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
211 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
212 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
213 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
214 <link doc="stream/ngx_stream_js_module.xml">ngx_stream_js_module</link> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
215 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
216 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
217 </list> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
218 Both modules are not built by default, |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
219 they should be either compiled from the sources |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
220 or installed as a Linux package. |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
221 </para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
222 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
223 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
224 <section id="install_package" name="Installing as a Linux package"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
225 <para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
226 For Linux, nginScript modules |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
227 <link doc="../linux_packages.xml" id="dynmodules">packages</link> can be used: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
228 <list type="bullet"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
229 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
230 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
231 <literal>nginx-module-njs</literal> — nginScript |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
232 <link doc="ngx_core_module.xml" id="load_module">dynamic</link> modules |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
233 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
234 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
235 <listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
236 <literal>nginx-module-njs-dbg</literal> — debug symbols for the |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
237 <literal>nginx-module-njs</literal> package |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
238 </listitem> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
239 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
240 </list> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
241 </para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
242 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
243 </section> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
244 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
245 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
246 <section id="install_sources" name="Building from the sources"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
247 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
248 <para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
249 The <link url="http://hg.nginx.org/njs">repository</link> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
250 with nginScript sources can be cloned with the following command: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
251 (requires <link url="https://www.mercurial-scm.org">Mercurial</link> client): |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
252 <example> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
253 hg clone http://hg.nginx.org/njs |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
254 </example> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
255 Then the modules should be compiled using the |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
256 <literal>--add_module</literal> configuration parameter: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
257 <example> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
258 ./configure --add-module=<value>path-to-njs</value>/nginx |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
259 </example> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
260 The modules can also be built as |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
261 <link doc="ngx_core_module.xml" id="load_module">dynamic</link>: |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
262 <example> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
263 ./configure --add-dynamic_module=<value>path-to-njs</value>/nginx |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
264 </example> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
265 </para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
266 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
267 </section> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
268 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
269 </section> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
270 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
271 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
272 <section id="issues" name="Known Issues"> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
273 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
274 <para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
275 Both modules are experimental, caveat emptor applies. |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
276 </para> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
277 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
278 </section> |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
279 |
bfac366fa1e4
Added article about nginScript.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
280 </article> |