In Model#bundle today, all object property values except contexts go through a toJSON() to get a serializable form of the values.
For consistency, this changes Model#bundle to use a new Contexts#toJSON as well, for consistency. That just loops
over each context and calls the existing Context#toJSON on each.
This doesn't change the final serialized JSON-string representation, as JSON.stringify automatically calls the contexts' #toJSON today. This just pushes those #toJSON calls a bit earlier.
In
Model#bundle
today, all object property values exceptcontexts
go through atoJSON()
to get a serializable form of the values.For consistency, this changes
Model#bundle
to use a newContexts#toJSON
as well, for consistency. That just loops over each context and calls the existingContext#toJSON
on each.This doesn't change the final serialized JSON-string representation, as
JSON.stringify
automatically calls the contexts'#toJSON
today. This just pushes those#toJSON
calls a bit earlier.