Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Assert presence of a native property on the global object... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
hasNative( key, message ); |
Parameters
Parameter | Type | Mandatory | Notes | API Version |
---|---|---|---|---|
key | String | The name of the property to inspect. | 1.0 | |
message | String | (<v1.4) (v1.4+) | A message stating what the assertion is testing. As of v1.4, message defaults to: | 1.0 1.4 |
Return Values
Value | Type | Notes | API Version |
---|---|---|---|
<error> | Error | Most likely the parameters are wrong. | 1.0 |
true | Boolean_global.hasOwnProperty(key) == true | The key is defined on the global object. | 1.0 |
false | Boolean_global.hasOwnProperty(key) == false | The key is missing from the global object. | 1.0 |
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Test("InequalityNative checks", Test.ANY( ), function() { // assertion will pass hasNative( "Math", "Math exists?" ); // assertion will fail (case-sensitive) equalhasNative( "math", "math exists?" ); }); |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Test APITopics:
|