1
0
Fork 0

Not running getter/setter override tests if unsupported by environment

closure/master
Mike Gerwitz 2011-06-14 23:00:37 -04:00
parent 5065525f0d
commit a1585a351e
2 changed files with 24 additions and 2 deletions

View File

@ -25,7 +25,8 @@
var common = require( './common' ), var common = require( './common' ),
assert = require( 'assert' ), assert = require( 'assert' ),
mb_common = require( __dirname + '/inc-member_builder-common' ), mb_common = require( __dirname + '/inc-member_builder-common' ),
builder = common.require( 'member_builder' ) builder = common.require( 'member_builder' ),
util = common.require( 'util' )
; ;
mb_common.funcVal = 'foobar'; mb_common.funcVal = 'foobar';
@ -298,6 +299,11 @@ mb_common.assertCommon();
*/ */
( function testCannotOverrideGetters() ( function testCannotOverrideGetters()
{ {
if ( util.definePropertyFallback() )
{
return;
}
mb_common.members[ 'public' ] = {}; mb_common.members[ 'public' ] = {};
Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, { Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, {
get: function() {}, get: function() {},
@ -334,6 +340,11 @@ mb_common.assertCommon();
*/ */
( function testCannotOverrideSetters() ( function testCannotOverrideSetters()
{ {
if ( util.definePropertyFallback() )
{
return;
}
mb_common.members[ 'public' ] = {}; mb_common.members[ 'public' ] = {};
Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, { Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, {
set: function() {}, set: function() {},

View File

@ -25,7 +25,8 @@
var common = require( './common' ), var common = require( './common' ),
assert = require( 'assert' ), assert = require( 'assert' ),
mb_common = require( __dirname + '/inc-member_builder-common' ), mb_common = require( __dirname + '/inc-member_builder-common' ),
builder = common.require( 'member_builder' ) builder = common.require( 'member_builder' ),
util = common.require( 'util' )
; ;
@ -73,6 +74,11 @@ mb_common.assertCommon();
*/ */
( function testCannotOverrideGetters() ( function testCannotOverrideGetters()
{ {
if ( util.definePropertyFallback() )
{
return;
}
mb_common.members[ 'public' ] = {}; mb_common.members[ 'public' ] = {};
Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, { Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, {
get: function() {}, get: function() {},
@ -109,6 +115,11 @@ mb_common.assertCommon();
*/ */
( function testCannotOverrideSetters() ( function testCannotOverrideSetters()
{ {
if ( util.definePropertyFallback() )
{
return;
}
mb_common.members[ 'public' ] = {}; mb_common.members[ 'public' ] = {};
Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, { Object.defineProperty( mb_common.members[ 'public' ], mb_common.name, {
set: function() {}, set: function() {},