You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
575 B

/*---
{
"custom": true
}
---*/
/*===
null
true
===*/
/* Test pointer formatting. NULL pointers are formatted consistenly and in
* a platform independent manner. Non-NULL pointers don't have a fixed format
* but test for an expected subset.
*/
function pointerTostringTest() {
var ptr_null = Duktape.Pointer();
var ptr_nonnull = Duktape.Pointer('dummy');
var re_ptr_nonnull = /^[0-9a-fA-Fx:]+$/;
print(ptr_null.toString());
print(re_ptr_nonnull.test(ptr_nonnull.toString()));
}
try {
pointerTostringTest();
} catch (e) {
print(e);
}