最近和同事在Debug代码时,遇到一个诡异的问题,开始以为是代码问题,分析了之后发现是VS(v16.8.3)的bug,特此分享一下,如果大家近期遇到类似的问题,不要茫然. 这个bug重现的方式是,在debug时,拖动"小箭头"到不满足条件的代码分支,如果这个分支包含闭包,则VS会立即抛出System.NullReferenceException: 'Object reference not set to an instance of an object.'(更诡异的是如果debug时强…
下面讲一下在FlashBuilder中如何添加编译器参数使我们在发布的时候不编译调试代码: 首先设置编译参数 编译参数设置好后,代码我们可以这样写: public class ConditionalCompilationTest extends Sprite { public function ConditionalCompilationTest() { CONFIG::DEBUG { var sp:Sprite = new Sprite(); sp.graphics.beginFill(0xf…