Skip to content

Commit c73dbb0

Browse files
author
Neil Fraser
committed
Add compile script for Windows
1 parent fe4558b commit c73dbb0

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

compile.bat

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@REM Script for generating the compiled acorn_interpreter.js file.
2+
@REM For Windows.
3+
4+
@REM Prerequisites:
5+
@REM 1. Ensure Java is installed. Open a command prompt and type 'java'.
6+
@REM 2. Ensure Python is installed. Open a command prompt and type 'python'.
7+
@REM 3. Use a web browser to download the compiler and place it in this directory.
8+
@REM https://unpkg.com/google-closure-compiler-java/compiler.jar
9+
10+
@REM Open a command prompt in this directory and run this file (compile.bat).
11+
12+
@REM Make a copy of the interpreter so that polyfill sources can be complied.
13+
copy interpreter.js interpreter.tmp.js
14+
15+
@REM This step is optional, but reduces the output by 5 KB.
16+
python polyfill_compile.py interpreter.tmp.js
17+
18+
@ECHO Compiling Acorn + JS-Interpreter...
19+
java -jar compiler.jar ^
20+
--compilation_level ADVANCED_OPTIMIZATIONS ^
21+
--language_in=ECMASCRIPT5 ^
22+
--language_out=ECMASCRIPT5 ^
23+
--warning_level VERBOSE ^
24+
--js='acorn.js' --js='interpreter.tmp.js' ^
25+
--js_output_file acorn_interpreter.js
26+
27+
del interpreter.tmp.js
28+
@ECHO Done

compile.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Script for generating the compiled acorn_interpreter.js file.
2+
# For Linux, BSD, MacOS, etc.
23

34
# Download Closure Compiler if not already present.
45
if test -f "compiler.jar"; then

polyfill_compile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
""" Process interpreter.tmp.js and compile the annotated polyfills.
1919
"""
2020

21-
_author__ = "[email protected] (Neil Fraser)"
21+
__author__ = "[email protected] (Neil Fraser)"
2222

2323
import json
2424
import os

0 commit comments

Comments
 (0)