Closed bllanos closed 9 years ago
So after running the project locally and creating a function that only console.log
'd, it seems, as we discovered, there is a problem when a function returns undefined
.
The following error occurs:
objectSpy error: Unknown type of call event passed to CallStore.add()
I made several updates:
undefined
values.@bsleighb if you can run a sanity check, I would appreciate it.
Works as advertised now :+1:
Requested reviewers: @bsleighb Issues: #10
Summary of Changes
Detailed Changes
Object wrapper code
object-spy
is firstly on how the client code sees the spy object. Side effects are part of this "perception".options
object around when appropriate.Observation event format
serialize-javascript
module is used to obtain string versions of values.lodash
cloneDeep
method cannot clone functions, for example.callData
keycall returned value
call threw exception
arguments
attributes.value
attribute of function call events stores the return value or thrown exception, as appropriate.Observation event storage
CallStore
, to store function call events.StoreManager
class.CallStore
class can be configured to store non-primitive values or not. This will affect memory usage, and report generation. (Reports will not be able to show the values of arguments and return values, regardless of report generation options, if non-primitive values are not stored.)copyCallObjectValues
option passed towatch()
insrc/watch/watch.coffee
.Reporter output
.
. This makes the path string non-empty for a call to an object that is a function. (I thought that empty paths were visually confusing, and they also caused problems with the report generation code.)LogStyleReporter
false
in order to avoid cluttering the report.Constants
OBSERVATION_CATEGORIES
into sub-categories; one for function call events and another for property-related events.Object.observe()
is available).Testing Performed
copyCallObjectValues
option passed towatch()
and theshowArguments
andshowObjectValues
options passed to theLogStyleReporter
class.LogStyleReporter
class.Aspects of #10 not implemented
To-do