@@ -45,19 +45,6 @@ function verifyProperty(obj, name, desc, options) {
45
45
return true ;
46
46
}
47
47
48
- var names = Object . getOwnPropertyNames ( desc ) ;
49
- for ( var i = 0 ; i < names . length ; i ++ ) {
50
- assert (
51
- names [ i ] === "value" ||
52
- names [ i ] === "writable" ||
53
- names [ i ] === "enumerable" ||
54
- names [ i ] === "configurable" ||
55
- names [ i ] === "get" ||
56
- names [ i ] === "set" ,
57
- "Invalid descriptor field: " + names [ i ] ,
58
- ) ;
59
- }
60
-
61
48
assert (
62
49
Object . prototype . hasOwnProperty . call ( obj , name ) ,
63
50
"obj should have an own property " + nameStr
@@ -75,14 +62,27 @@ function verifyProperty(obj, name, desc, options) {
75
62
"The desc argument should be an object or undefined, " + String ( desc )
76
63
) ;
77
64
65
+ var names = Object . getOwnPropertyNames ( desc ) ;
66
+ for ( var i = 0 ; i < names . length ; i ++ ) {
67
+ assert (
68
+ names [ i ] === "value" ||
69
+ names [ i ] === "writable" ||
70
+ names [ i ] === "enumerable" ||
71
+ names [ i ] === "configurable" ||
72
+ names [ i ] === "get" ||
73
+ names [ i ] === "set" ,
74
+ "Invalid descriptor field: " + names [ i ] ,
75
+ ) ;
76
+ }
77
+
78
78
var failures = [ ] ;
79
79
80
80
if ( Object . prototype . hasOwnProperty . call ( desc , 'value' ) ) {
81
81
if ( ! isSameValue ( desc . value , originalDesc . value ) ) {
82
82
failures . push ( "descriptor value should be " + desc . value ) ;
83
83
}
84
84
if ( ! isSameValue ( desc . value , obj [ name ] ) ) {
85
- failures . push ( failures , "object value should be " + desc . value ) ;
85
+ failures . push ( "object value should be " + desc . value ) ;
86
86
}
87
87
}
88
88
0 commit comments