Oops. Dummy want to name things correctly? (#25)
parent
0f244ac4aa
commit
24e9dd2549
|
@ -142,7 +142,7 @@ exports.buildMethod = function(
|
||||||
{
|
{
|
||||||
// we are not overriding the method, so simply copy it over, wrapping it
|
// we are not overriding the method, so simply copy it over, wrapping it
|
||||||
// to ensure privileged calls will work properly
|
// to ensure privileged calls will work properly
|
||||||
dest[ name ] = this._overrideMethod( value, null, instCallback, cid );
|
dest[ name ] = this._overrideMethod( null, value, instCallback, cid );
|
||||||
}
|
}
|
||||||
|
|
||||||
// store keywords for later reference (needed for pre-ES5 fallback)
|
// store keywords for later reference (needed for pre-ES5 fallback)
|
||||||
|
@ -579,11 +579,11 @@ exports._overrideMethod = function(
|
||||||
// __super property
|
// __super property
|
||||||
var override = null;
|
var override = null;
|
||||||
|
|
||||||
// should we override or wrap as a new method?
|
// are we overriding?
|
||||||
override = (
|
override = (
|
||||||
( new_method )
|
( super_method )
|
||||||
? this._wrapMethod
|
? this._wrapOverride
|
||||||
: this._wrapOverride
|
: this._wrapMethod
|
||||||
).wrapMethod( new_method, super_method, cid, instCallback );
|
).wrapMethod( new_method, super_method, cid, instCallback );
|
||||||
|
|
||||||
// This is a trick to work around the fact that we cannot set the length
|
// This is a trick to work around the fact that we cannot set the length
|
||||||
|
@ -593,7 +593,7 @@ exports._overrideMethod = function(
|
||||||
// compatibility with its super method.
|
// compatibility with its super method.
|
||||||
util.defineSecureProp( override,
|
util.defineSecureProp( override,
|
||||||
'__length',
|
'__length',
|
||||||
( super_method.__length || super_method.length )
|
( new_method.__length || new_method.length )
|
||||||
);
|
);
|
||||||
|
|
||||||
return override;
|
return override;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
exports.standard = {
|
exports.standard = {
|
||||||
wrapNew: function( method, super_method, cid, getInst )
|
wrapOverride: function( method, super_method, cid, getInst )
|
||||||
{
|
{
|
||||||
return function()
|
return function()
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ exports.standard = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
wrapOverride: function( method, super_method, cid, getInst )
|
wrapNew: function( method, super_method, cid, getInst )
|
||||||
{
|
{
|
||||||
return function()
|
return function()
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ exports.standard = {
|
||||||
;
|
;
|
||||||
|
|
||||||
// invoke the method
|
// invoke the method
|
||||||
retval = super_method.apply( context, arguments );
|
retval = method.apply( context, arguments );
|
||||||
|
|
||||||
// if the value returned from the method was the context that we
|
// if the value returned from the method was the context that we
|
||||||
// passed in, return the actual instance (to ensure we do not break
|
// passed in, return the actual instance (to ensure we do not break
|
||||||
|
|
Loading…
Reference in New Issue