mirror of https://github.com/svaarala/duktape.git
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.
30 lines
574 B
30 lines
574 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);
|
|
}
|
|
|