erazor icon indicating copy to clipboard operation
erazor copied to clipboard

haxe Statics don't work

Open postite opened this issue 12 years ago • 1 comments

Hi guys ! i recently noticed that haxe Statics like Math or Std doesnt work (at least for macros). i ran the test to verify and it doesnt pass !! (..) /test/erazor/TestMacro.hx:123: character 10 : { x : Float } has no field Math

even putting the typedef as Dynamic i get the same error. Is it a non-feature, a known bug ? are there some solutions using Helpers or what ? thx

postite avatar Jan 24 '13 10:01 postite

This is not a bug but a feature. The point is that for runtime templates you need to explicitly pass whatever you want to expose. So if you want to pass the Math functions you should reference Math in your data object. The idea is to secure templates from improper usage of certain methods. Another option would be to extend erazor to include certain helper types.

fponticelli avatar Jan 24 '13 14:01 fponticelli