22 |
22 |
23 hg clone https://bitbucket.org/gxti/hgforest |
23 hg clone https://bitbucket.org/gxti/hgforest |
24 |
24 |
25 You can clone Nashorn Mercurial forest using this command: |
25 You can clone Nashorn Mercurial forest using this command: |
26 |
26 |
27 hg fclone http://hg.openjdk.java.net/nashorn/jdk8 nashorn~jdk8 |
27 hg fclone http://hg.openjdk.java.net/nashorn/jdk9 nashorn~jdk9 |
28 |
28 |
29 To update your copy of the forest (fwith the latest code: |
29 To update your copy of the forest (fwith the latest code: |
30 |
30 |
31 (cd nashorn~jdk8 ; hg fpull) |
31 (cd nashorn~jdk9 ; hg fpull) |
32 |
32 |
33 Or just the nashorn subdirectory with |
33 Or just the nashorn subdirectory with |
34 |
34 |
35 (cd nashorn~jdk8/nashorn ; hg pull -u) |
35 (cd nashorn~jdk9/nashorn ; hg pull -u) |
36 |
36 |
37 To learn about Mercurial in detail, please visit http://hgbook.red-bean.com. |
37 To learn about Mercurial in detail, please visit http://hgbook.red-bean.com. |
38 |
38 |
39 - How to build? |
39 - How to build? |
40 |
40 |
41 To build Nashorn, you need to install JDK 8. You may use the Nashorn |
41 To build Nashorn, you need to install JDK 9. You may use the Nashorn |
42 forest build (recommended) or down load from java.net. You will need to |
42 forest build (recommended) or down load from java.net. You will need to |
43 set JAVA_HOME environmental variable to point to your JDK installation |
43 set JAVA_HOME environmental variable to point to your JDK installation |
44 directory. |
44 directory. |
45 |
45 |
46 cd nashorn~jdk8/nashorn/make |
46 cd nashorn~jdk9/nashorn/make |
47 ant clean; ant |
47 ant clean; ant |
48 |
48 |
49 - How to run? |
49 - How to run? |
50 |
50 |
51 Use the jjs script (see RELESE_README): |
51 Use the jjs script (see RELESE_README): |
52 |
52 |
53 cd nashorn~jdk8/nashorn |
53 cd nashorn~jdk9/nashorn |
54 sh bin/jjs <your .js file> |
54 sh bin/jjs <your .js file> |
55 |
55 |
56 Nashorn supports javax.script API. It is possible to drop nashorn.jar in |
56 Nashorn supports javax.script API. It is possible to drop nashorn.jar in |
57 class path and request for "nashorn" script engine from |
57 class path and request for "nashorn" script engine from |
58 javax.script.ScriptEngineManager. |
58 javax.script.ScriptEngineManager. |
88 |
88 |
89 Alternatively, you can check it out elsewhere and make |
89 Alternatively, you can check it out elsewhere and make |
90 test/script/external/test262 a symbolic link to that directory. After |
90 test/script/external/test262 a symbolic link to that directory. After |
91 you've done this, you can run the ECMA-262 tests using: |
91 you've done this, you can run the ECMA-262 tests using: |
92 |
92 |
93 cd nashorn~jdk8/nashorn/make |
93 cd nashorn~jdk9/nashorn/make |
94 ant test262 |
94 ant test262 |
95 |
95 |
96 Ant target to get/update external test suites: |
96 Ant target to get/update external test suites: |
97 |
97 |
98 ant externals |
98 ant externals |
99 ant update-externals |
99 ant update-externals |
100 |
100 |
101 These tests take time, so we have a parallelized runner for them that |
101 These tests take time, so we have a parallelized runner for them that |
102 takes advantage of all processor cores on the computer: |
102 takes advantage of all processor cores on the computer: |
103 |
103 |
104 cd nashorn~jdk8/nashorn/make |
104 cd nashorn~jdk9/nashorn/make |
105 ant test262parallel |
105 ant test262parallel |
106 |
106 |
107 - How to write your own test? |
107 - How to write your own test? |
108 |
108 |
109 Nashorn uses it's own simple test framework. Any .js file dropped under |
109 Nashorn uses it's own simple test framework. Any .js file dropped under |