michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Function can be passed as argument michael@0: * michael@0: * @path ch13/13.0/S13_A9.js michael@0: * @description Using function as argument of another function michael@0: */ michael@0: michael@0: function __func__INC(arg){return arg + 1;}; michael@0: function __func__MULT(incrementator, arg, mult){ return incrementator(arg)*mult; }; michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (__func__MULT(__func__INC, 2, 2) !== 6) { michael@0: $ERROR('#1: function can be passed as argument'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: