compile prop.toString method

This commit is contained in:
Barney Carroll 2016-07-14 13:27:48 +01:00
parent 3d02aeae36
commit f3a4a7e1eb
2 changed files with 39 additions and 7 deletions

View file

@ -7,18 +7,15 @@ function createStream() {
return stream._state.value
}
initStream(stream, arguments)
if (arguments.length > 0) updateStream(stream, arguments[0], undefined)
return stream
}
function initStream(stream, args) {
stream.constructor = createStream
stream._state = {id: guid++, value: undefined, error: undefined, state: 0, derive: undefined, recover: undefined, deps: {}, parents: [], errorStream: undefined, endStream: undefined}
stream.map = map, stream.ap = ap, stream.of = createStream
stream.valueOf = valueOf, stream.toJSON = toJSON
stream.valueOf = valueOf, stream.toJSON = toJSON, stream.toString = valueOf
stream.run = run, stream.catch = doCatch
Object.defineProperties(stream, {
error: {get: function() {
if (!stream._state.errorStream) {
@ -130,10 +127,8 @@ function initDependency(dep, streams, derive, recover) {
state.derive = derive
state.recover = recover
state.parents = streams.filter(notEnded)
registerDependency(dep, state.parents)
updateDependency(dep, true)
return dep
}
function registerDependency(stream, parents) {
@ -1066,7 +1061,6 @@ m.route = function($window, renderer, pubsub) {
route.prefix = router.setPrefix
route.set = router.setPath
route.get = router.getPath
return route
}(window, renderService, redrawService)
m.mount = function(renderer, pubsub) {