From 84363aca4531af8c9a1154b13a21ad3c5bc999b8 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 10 Mar 2011 12:24:59 -0500 Subject: [PATCH] Added test to ensure correct instance is returned when returning 'this' from a parent method --- test/test-class-visibility.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test-class-visibility.js b/test/test-class-visibility.js index 67f07e6..a02fb71 100644 --- a/test/test-class-visibility.js +++ b/test/test-class-visibility.js @@ -334,5 +334,12 @@ var common = require( './common' ), foo, "Returning 'this' from a method should return instance of self" ); + + // what happens in the case of inheritance? + assert.deepEqual( + sub_foo.getSelf(), + sub_foo, + "Returning 'this' from a super method should return the subtype" + ); } )();