diff --git a/lib/MethodWrappers.js b/lib/MethodWrappers.js index 2f88cca..e000a60 100644 --- a/lib/MethodWrappers.js +++ b/lib/MethodWrappers.js @@ -59,7 +59,11 @@ exports.standard = { return retval; }; - retf.super = super_method; + // `super` is reserved and, in ES3, this causes problems with the + // dot-notation; while `foo.super` will work fine in modern (ES5) + // browsers, we need to maintain our ES3 compatibility + retf['super'] = super_method; + return retf; }, diff --git a/test/MethodWrappersTest.js b/test/MethodWrappersTest.js index b3d740f..6f73e7b 100644 --- a/test/MethodWrappersTest.js +++ b/test/MethodWrappersTest.js @@ -229,8 +229,9 @@ require( 'common' ).testCase( ; // we should be able to invoke the super method by override.super, - // which is added atop of the wrapper - this.assertStrictEqual( override.super(), expected ); + // which is added atop of the wrapper (note that we quote it to avoid + // problems with ES3 engines) + this.assertStrictEqual( override['super'](), expected ); },