There are two problems I'm trying to solve here.
1) Somewhere along the way, exprToFunction gained a hardcoded
assumption that two stack frames up is a variable "expr",
meaning anything that called installExprFunction had to have
the first argument be exactly "expr". I think I got this
fixed, now the only assumption made by both installExprFunc
and exprToFunc is if they are called with quoted = FALSE,
then the caller is merely passing through code that originated
exactly one more level up the stack frame. If the code is
less than one level up, i.e. an end user is directly passing
code into installExprFunction or exprToFunction, then it won't
work; and if the code is more than one level up (someone is
passing code into function A which passes through to function
B which calls installExprFunction, with quoted = FALSE) then
it also won't work.
2) registerDebugHook calls were broken in various places by the
name/envir registered with the hook being different than the
name/envir through which the function was actually called.
This generally seems fixable by moving the registerDebugHook
call closer to the name/envir that will ultimately be called
(e.g. call registerDebugHook directly from wrapFunctionLabel).
There still seems to be a problem here in that breakpoints in
RStudio are hit but then the IDE automatically runs "n" multiple
times. Also the unit tests don't currently pass, I haven't
investigated that yet.
Validation errors were behaving too much like real errors: they were
being printed with stack traces, and passed to the options(shiny.error)
function. Also, if a reactive() cached a validation error, on future
calls the error would be re-raised (which is correct) without the
custom class names attached (which is not).
- More selective removal of frames at end of call stack
- Add withLogErrors, printError, stripStackTrace convenience funcs
- Properly capture/log errors for various levels of unhandled errors
- Unhide stacks for flush/flushed/sessionended callbacks
for R <= 3.2.2, Unicode chars don't work for shiny mainly because we want to
preserve the source reference, and unfortunately srcfilecopy() fails because of
the bug https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16264
here I use lines = '' to get around the bug, and assign the source lines to
the srcfile object later, so there is no grep("\n", multibyte_chars) occuring
I also replaced source() with a custom version, which is much simpler and works
better with Unicode chars
e.g. iconv('\u2264', 'UTF-8') converts the smaller than or equal sign to an
equal sign in the English (US) locale, which is lossy
we just assume the input is UTF-8 instead, and do not fall back to native
encoding any more
This reverts commits deffc90, ab4dc64, and 0755579, returning to RJSONIO.
The purpose of this is to prepare for a maintenance release for 0.11
without the switch to jsonlite, to reduce the risk of new bugs.