Index: sdk/bin/dart2js |
=================================================================== |
--- sdk/bin/dart2js (revision 27645) |
+++ sdk/bin/dart2js (working copy) |
@@ -33,7 +33,7 @@ |
# Stdout is a terminal. |
if test 8 -le `tput colors`; then |
# Stdout has at least 8 colors, so enable colors. |
- EXTRA_OPTIONS[${#EXTRA_OPTIONS[@]}]='--enable-diagnostic-colors' |
+ EXTRA_OPTIONS+=('--enable-diagnostic-colors') |
fi |
fi |
@@ -41,7 +41,7 @@ |
declare -a EXTRA_VM_OPTIONS |
if test -f "$SNAPSHOT"; then |
- EXTRA_OPTIONS[${#EXTRA_OPTIONS[@]}]="--library-root=$SDK_DIR" |
+ EXTRA_OPTIONS+=("--library-root=$SDK_DIR") |
fi |
# Tell the VM to grow the heap more aggressively. This should only |
@@ -52,10 +52,16 @@ |
case $0 in |
*_developer) |
- EXTRA_VM_OPTIONS[${#EXTRA_VM_OPTIONS[@]}]='--checked' |
+ EXTRA_VM_OPTIONS+=('--checked') |
;; |
esac |
+# We allow extra vm options to be passed in through an environment variable. |
+if [[ $DART_VM_OPTIONS ]]; then |
+ read -a OPTIONS <<< "$DART_VM_OPTIONS" |
+ EXTRA_VM_OPTIONS+=("${OPTIONS[@]}") |
+fi |
+ |
if test -f "$SNAPSHOT"; then |
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@" |
else |