Browse Source

changing to i32 to match spidermonkey

pull/5/head
Jason Williams 6 years ago
parent
commit
91f84e1000
  1. 2
      src/lib/js/value.rs
  2. 2
      tests/js/test.js

2
src/lib/js/value.rs

@ -163,7 +163,7 @@ impl ValueData {
// TODO: Move this to a better place // TODO: Move this to a better place
if self.is_string() && field == "length" { if self.is_string() && field == "length" {
if let ValueData::String(ref s) = *self { if let ValueData::String(ref s) = *self {
return Some(Property::new(to_value(s.len() as f64))) return Some(Property::new(to_value(s.len() as i32)))
} }
} }

2
tests/js/test.js

@ -1,4 +1,2 @@
var a = 'jabrjjja888'; var a = 'jabrjjja888';
a.length;
a = "jase";
a.length; a.length;
Loading…
Cancel
Save