Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(800)

Side by Side Diff: pkg/dev_compiler/tool/ddc

Issue 2815913002: add scripts to run/debug DDC output on simple test cases (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/dev_compiler/tool/ddw » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2 #
3 # Compiles code with DDC and runs the resulting code in node.js.
4 #
5 # The first script supplied should be the one with `main()`.
6 #
7 # Saves the output in the same directory as the sources for convenient
8 # inspection, modification or rerunning the code.
9 #
10 set -e
11 DDC_PATH=$( cd $( dirname "${BASH_SOURCE[0]}" )/.. && pwd )
12 BASENAME=$( basename "${1%.*}")
13 LIBROOT=$(cd $( dirname "${1%.*}") && pwd)
14 export NODE_PATH=$DDC_PATH/lib/js/common:$LIBROOT:$NODE_PATH
15 dart -c $DDC_PATH/bin/dartdevc.dart --modules=node --library-root=$LIBROOT \
16 --dart-sdk-summary=$DDC_PATH/lib/sdk/ddc_sdk.sum \
17 -o $LIBROOT/$BASENAME.js $*
18 pushd $LIBROOT > /dev/null
19 # TODO(jmesserly): we could have this output the same content as the devtool
20 # script, so you could debug the output without recompiling?
21 echo "
22 let sdk = require(\"dart_sdk\");
23 let main = require(\"$BASENAME\").$BASENAME.main;
24 sdk._isolate_helper.startRootIsolate(main, []);" \
25 > $LIBROOT/$BASENAME.run.js
26 node $BASENAME.run.js
27 popd > /dev/null
OLDNEW
« no previous file with comments | « no previous file | pkg/dev_compiler/tool/ddw » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698