1
0
Fork 0

Resolved IE8 test failures

- Additional checks for its buggy defineProperty(), etc implementation
closure/master
Mike Gerwitz 2011-11-18 08:57:37 -05:00
parent 18c31cc9e5
commit 94419742c0
4 changed files with 9 additions and 5 deletions

View File

@ -434,7 +434,8 @@ exports.arrayShrink = function( items )
* *
* @return {Object} descriptor for requested property or undefined if not found * @return {Object} descriptor for requested property or undefined if not found
*/ */
exports.getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor exports.getOwnPropertyDescriptor =
( can_define_prop && Object.getOwnPropertyDescriptor )
|| function( obj, prop ) || function( obj, prop )
{ {
if ( !Object.prototype.hasOwnProperty.call( obj, prop ) ) if ( !Object.prototype.hasOwnProperty.call( obj, prop ) )

View File

@ -22,8 +22,10 @@
* @package test * @package test
*/ */
var shared = require( __dirname + '/inc-common' ), var common = require( 'common' ),
es5 = ( typeof Object.defineProperty === 'function' ) ? true : false; shared = require( __dirname + '/inc-common' ),
es5 = !( common.require( 'util' ).definePropertyFallback() )
;
require( 'common' ).testCase( require( 'common' ).testCase(
{ {

View File

@ -23,7 +23,8 @@
*/ */
// get-set-test (supported) // get-set-test (supported)
var gst = ( typeof Object.defineProperty === 'function' ) ? true : false; var common = require( 'common' ),
gst = !( common.require( 'util' ).definePropertyFallback() )
require( 'common' ).testCase( require( 'common' ).testCase(

View File

@ -36,7 +36,7 @@ var common = require( './common' ),
*/ */
( function testUtilGetOwnPropertyDescriptorIsObjectsIfAvailable() ( function testUtilGetOwnPropertyDescriptorIsObjectsIfAvailable()
{ {
if ( Object.getOwnPropertyDescriptor ) if ( get_set && Object.getOwnPropertyDescriptor )
{ {
assert.strictEqual( assert.strictEqual(
util.getOwnPropertyDescriptor, util.getOwnPropertyDescriptor,