-
Notifications
You must be signed in to change notification settings - Fork 751
Closed
Milestone
Description
My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior.
console.history is not cleared when used with prerender method using therubyracer runtime.
Here is an example extracted from the sprockets_renderer_test
@renderer.render("TodoListWithConsoleLog", {todos: ["log some messages"]}, nil)
puts @renderer.render("TodoListWithConsoleLog", {todos: ["log some messages"]}, nil)will result to
<ul data-reactroot="" data-reactid="1" data-react-checksum="-1309656939"><li data-reactid="2">Console Logged</li><li id="status" data-reactid="3">yep</li><li data-reactid="4">log some messages</li></ul>
<script>
console.log.apply(console, ["got initial state"]);
console.warn.apply(console, ["mounted component"]);
console.error.apply(console, ["rendered!","foo"]);
console.log.apply(console, ["got initial state"]);
console.warn.apply(console, ["mounted component"]);
console.error.apply(console, ["rendered!","foo"]);
</script>The rubyracer v8_context deep inside is the same during multiple evals, and so is other stuff user might stored in global.
This is not happened in the default execjs runtime given that it shell out every time eval invoked.
Test environment
react-rails: mastertherubyracer: 0.12.2
Metadata
Metadata
Assignees
Labels
No labels