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
parent
dd0b632274
commit
de9cc8f66f
|
@ -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;
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
*/
|
||||
|
||||
var util = require( __dirname + '/util' ),
|
||||
Warning = require( __dirname + '/warn' ).Warning,
|
||||
visibility = [ 'public', 'protected', 'private' ]
|
||||
;
|
||||
|
||||
|
|
|
@ -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}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue