 
 package {
 
-    import flash.utils.*; // for our ByteArray clone - either it should die, or we rename the package in our clone!
-
-    public function compileString(str, fname:String = "", startLineNumber:int = 0): ByteArray
-    {
-        import Parse.*;
-        import Lex.*; // needed to set lnCoord below, for reasons too magic for markh :)
-        var top = []
-
-        var parser = new Parser(str,top,fname);
-        parser.scan.lnCoord += startLineNumber;
-        var prog = parser.program();
-        var bytes = Gen::cg(prog).getBytes();
-
-        var b = new ByteArray();
-        b.endian = "littleEndian";
-
-        for (var i = 0, len = bytes.length; i<len; ++i) {
-            b.writeByte(uint(bytes[i]));
-        }
-        return b
-    }
+	import flash.utils.*; // for our ByteArray clone - either it should die, or we rename the package in our clone!
+
+	public function compileString(str, fname:String = "", startLineNumber:int = 0)
+	{
+// Bug 432242 is adding a 'compileStringToBytes' function, but its not checked in
+// yet - so reimplement it ourselves.  Note that line numbers will be broken until
+// that bug is fixed.
+//		use namespace ESC;
+//		var bytes = ESC::compileStringToBytes(str, fname, startLineNumber+1);
+		var bytes;
+		ESC::compile( function () { return str },
+					  function (abc) { bytes = abc.getBytes() },
+					  fname);
+		return bytes;
+	}
 }
 
 package {

	// (such as Window) returns a COM error code.  These are never thrown by script code,
	// and are treated as "unhandled" when the occur - eg, a traceback is printed, debugger
	// semantics followed, etc.
	public dynamic class ConsumerError extends Error {
		function ConsumerError(hresult, excepinfo:EXCEPINFO = null) {
			super(hresult, excepinfo)
		}

 * ***** END LICENSE BLOCK ***** */

// hackery - for now, this file is "built" via:
// %java -ea -DAS3 -DAVMPLUS -classpath ../utils/asc.jar macromedia.asc.embedding.ScriptCompiler -abcfuture -builtin -d -import ../core/builtin.abc -import ../esc/bin/esc-core.es.abc -import ../esc/bin/eval-support.es.abc -out axtoplevel mscom.as Domain.as ../shell/ByteArray.as && move /y ..\shell\axtoplevel.* .
// Note the '-d' will include debug info which is handy in the early days...

package axtam 
{
