mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
parent
6ff3a5a3c1
commit
0fbfb8cffc
4 changed files with 13 additions and 17 deletions
|
@ -9,8 +9,8 @@
|
|||
use actor::{Actor, ActorRegistry};
|
||||
use protocol::JsonPacketStream;
|
||||
|
||||
use devtools_traits::{NullValue, VoidValue, NumberValue, StringValue, BooleanValue};
|
||||
use devtools_traits::{ActorValue, DevtoolScriptControlMsg};
|
||||
use devtools_traits;
|
||||
use devtools_traits::{DevtoolScriptControlMsg};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
|
||||
use collections::BTreeMap;
|
||||
|
@ -226,18 +226,18 @@ impl Actor for ConsoleActor {
|
|||
|
||||
//TODO: extract conversion into protocol module or some other useful place
|
||||
let result = match try!(port.recv().map_err(|_| ())) {
|
||||
VoidValue => {
|
||||
devtools_traits::EvaluateJSReply::VoidValue => {
|
||||
let mut m = BTreeMap::new();
|
||||
m.insert("type".to_string(), "undefined".to_string().to_json());
|
||||
Json::Object(m)
|
||||
}
|
||||
NullValue => {
|
||||
devtools_traits::EvaluateJSReply::NullValue => {
|
||||
let mut m = BTreeMap::new();
|
||||
m.insert("type".to_string(), "null".to_string().to_json());
|
||||
Json::Object(m)
|
||||
}
|
||||
BooleanValue(val) => val.to_json(),
|
||||
NumberValue(val) => {
|
||||
devtools_traits::EvaluateJSReply::BooleanValue(val) => val.to_json(),
|
||||
devtools_traits::EvaluateJSReply::NumberValue(val) => {
|
||||
if val.is_nan() {
|
||||
let mut m = BTreeMap::new();
|
||||
m.insert("type".to_string(), "NaN".to_string().to_json());
|
||||
|
@ -258,8 +258,8 @@ impl Actor for ConsoleActor {
|
|||
val.to_json()
|
||||
}
|
||||
}
|
||||
StringValue(s) => s.to_json(),
|
||||
ActorValue(s) => {
|
||||
devtools_traits::EvaluateJSReply::StringValue(s) => s.to_json(),
|
||||
devtools_traits::EvaluateJSReply::ActorValue(s) => {
|
||||
//TODO: make initial ActorValue message include these properties.
|
||||
let mut m = BTreeMap::new();
|
||||
m.insert("type".to_string(), "object".to_string().to_json());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue