1
0
Fork 0

Removed unneeded warning handling

This removes warning references and, more importantly, a rather encompasing
try/catch block that would prohibit optimizations in engines like v8 (at
least at the time of writing).
perfodd
Mike Gerwitz 2014-03-28 23:46:35 -04:00
parent dd0b632274
commit de9cc8f66f
3 changed files with 16 additions and 35 deletions

View File

@ -25,9 +25,6 @@
*/
var util = require( __dirname + '/util' ),
warn = require( __dirname + '/warn' ),
Warning = warn.Warning,
hasOwn = Object.prototype.hasOwnProperty,
@ -357,36 +354,21 @@ exports.prototype.build = function extend( _, __ )
// build the various class components (XXX: this is temporary; needs
// refactoring)
try
{
this.buildMembers( props,
this._classId,
base,
prop_init,
{
all: members,
'abstract': abstract_methods,
'static': static_members,
'virtual': virtual_members,
},
function( inst )
{
return new_class.___$$svis$$;
}
);
}
catch ( e )
{
// intercept warnings /only/
if ( e instanceof Warning )
this.buildMembers( props,
this._classId,
base,
prop_init,
{
warn.handle( e );
}
else
all: members,
'abstract': abstract_methods,
'static': static_members,
'virtual': virtual_members,
},
function( inst )
{
throw e;
return new_class.___$$svis$$;
}
}
);
// reference to the parent prototype (for more experienced users)
prototype.___$$parent$$ = base.prototype;

View File

@ -30,7 +30,6 @@
*/
var util = require( __dirname + '/util' ),
Warning = require( __dirname + '/warn' ).Warning,
visibility = [ 'public', 'protected', 'private' ]
;

View File

@ -76,10 +76,10 @@ exports.prototype.end = function( state )
/**
* Enqueue warning within validation state
*
* @param {Object} state validation state
* @param {string} member member name
* @param {string} id warning identifier
* @param {Warning} warn warning
* @param {Object} state validation state
* @param {string} member member name
* @param {string} id warning identifier
* @param {Error} warn warning
*
* @return {undefined}
*/