Open waneck opened 11 years ago
[comment from si...@haxe.org, published at 2013-05-19T10:11:03.000Z] class Main { static public function main() { var x = try { throw "foo"; true; } catch (e:String) { false; } } }
It seems to come from having a right-side try/catch expression and compiling in debug mode.
function Main_0() { try { throw new HException("foo"); return true; }catch(Exception $hxe) { $ex = ($hxe instanceof HException) ? $hxe->e : $hxe; if(is_string($e = $ex)){ $GLOBALS['%e'] = new _hx_array(array()); while($GLOBALS['%s']->length >= $hxspos) { $GLOBALS['%e']->unshift($GLOBALS['%s']->pop()); } $GLOBALS['%s']->push($GLOBALS['%e'][0]); return false; } else throw $hxe;; } }
The while loop tries to compare against $hxspos, which is not defined in this context.
Franco, could you please take a look at this? I'm pretty sure this is an easy fix that comes down to generating a $hxspos in a particular place.
[comment from si...@haxe.org, published at 2013-05-24T09:41:09.000Z] I've worked around it.
[Google Issue #1828 : http://code.google.com/haxe/issues/detail?id=1828] by si...@haxe.org, at 2013-05-19T09:28:44.000Z Test.hx:198: ABORTED : Undefined variable: hxspos (errno: 8) in C:\haxe\trunk\tests\unit\php\lib\haxe\ds\BalancedTree.class.php at line #276 in unit.TestSpecification.testEnumValueMap_unit_hx Test.hx:200: STACK :
Called from haxe.ds.BalancedTree.removeLoop Called from haxe.ds.BalancedTree.remove Called from unit.TestSpecification.testEnumValueMap_unit_hx Called from Reflect.callMethod Called from unit.Test.main
This is critical because the class is part of the standard. I might be able to work around this for haxe 3 release, but I don't quite understand the origin of the problem.