static void addExtern ( AbstractCompiler compiler ) { Node name = IR . name ( PROTECTOR_FN ) ; name . putBooleanProp ( Node . IS_CONSTANT_NAME , true ) ; Node var = IR . var ( name ) ; JSDocInfoBuilder builder = new JSDocInfoBuilder ( false ) ; var . setJSDocInfo ( builder . build ( ) ) ; CompilerInput input = compiler . getSynthesizedExternsInput ( ) ; Node root = input . getAstRoot ( compiler ) ; name . setStaticSourceFileFrom ( root ) ; var . setStaticSourceFileFrom ( root ) ; root . addChildToBack ( var ) ; compiler . reportChangeToEnclosingScope ( var ) ; }
Injects JSCOMPILER_PRESEVE into the synthetic externs