svaarala / duktape

Duktape - embeddable Javascript engine with a focus on portability and compact footprint
MIT License
5.87k stars 514 forks source link

API call to summarize any value into a string without side effects #776

Open svaarala opened 8 years ago

svaarala commented 8 years ago

The property access error messages use an internal mechanism to "summarize" any tagged value safely without side effects. For example, strings are automatically quoted and sanitized (and truncated if too long), etc.

This internal API call could be cleaned up and made available to user code.

fatcerberus commented 7 years ago

Is this still planned for v2.0? I would like to have this for use in SSJ. It'd be nice if there were a debug command for it too, but since we have AppRequests now, that's not strictly necessary. :)

svaarala commented 7 years ago

It is, but it's not certain it'll make the release, as there's some other stuff to do too :)

fatcerberus commented 7 years ago

That's fine, it's an API addition so it can land in a semver-minor release with no issue.

fatcerberus commented 7 years ago

That said, I'll do my best to accelerate the process anyway. ;-)

svaarala commented 7 years ago

Thanks, appreciate it :)

svaarala commented 7 years ago

I'll drop the value summary issues/pulls from 2.0.0 release. They can be introduced as backwards compatible API calls if the concept makes sense.