From 0389c9d9d56ce9003234cc3a46690a50c2495068 Mon Sep 17 00:00:00 2001 From: Nicolas Cannasse Date: Sun, 24 Feb 2013 17:13:15 +0000 Subject: [PATCH] haxe3 update --- Test.hx | 16 +++++++++------- hscript.hxml | 1 + hscript.hxproj | 2 +- hscript/Interp.hx | 22 ++++++++++++++-------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Test.hx b/Test.hx index 2fc7465..db7e585 100644 --- a/Test.hx +++ b/Test.hx @@ -17,14 +17,12 @@ class Test { test("0",0); test("0xFF", 255); #if haxe3 - test("n(0xBFFFFFFF)",0xBFFFFFFF); - test("n(0x7FFFFFFF)", 0x7FFFFFFF); - #else - #if !neko + test("0xBFFFFFFF",0xBFFFFFFF); + test("0x7FFFFFFF", 0x7FFFFFFF); + #elseif !neko test("n(0xBFFFFFFF)",0xBFFFFFFF,{ n : haxe.Int32.toNativeInt }); test("n(0x7FFFFFFF)", 0x7FFFFFFF, { n : haxe.Int32.toNativeInt } ); #end - #end test("-123",-123); test("- 123",-123); test("1.546",1.546); @@ -70,8 +68,12 @@ class Test { test("(function(a,b) return a + b)(4,5)",9); test("var y = 0; var add = function(a) y += a; add(5); add(3); y", 8); test("var a = [1,[2,[3,[4,null]]]]; var t = 0; while( a != null ) { t += a[0]; a = a[1]; }; t",10); - test("var t = 0; for( x in 1...10 ) t += x; t",45); - test("var t = 0; for( x in new IntIter(1,10) ) t +=x; t",45,{ IntIter : #if (haxe3 || haxe_211) IntIterator #else IntIter #end }); + test("var t = 0; for( x in 1...10 ) t += x; t", 45); + #if haxe3 + test("var t = 0; for( x in new IntIterator(1,10) ) t +=x; t", 45); + #else + test("var t = 0; for( x in new IntIter(1,10) ) t +=x; t", 45); + #end test("var x = 1; try { var x = 66; throw 789; } catch( e : Dynamic ) e + x",790); test("var x = 1; var f = function(x) throw x; try f(55) catch( e : Dynamic ) e + x",56); test("var i=2; if( true ) --i; i",1); diff --git a/hscript.hxml b/hscript.hxml index 1106017..2df61ff 100644 --- a/hscript.hxml +++ b/hscript.hxml @@ -3,3 +3,4 @@ --flash-strict -swf-version 9 -main Test +-dce no diff --git a/hscript.hxproj b/hscript.hxproj index c1bda34..bea2adc 100644 --- a/hscript.hxproj +++ b/hscript.hxproj @@ -23,7 +23,7 @@