Browse Source

fixing master

pull/70/head
Jason Williams 5 years ago
parent
commit
2427b3b755
  1. 4
      src/lib/js/string.rs

4
src/lib/js/string.rs

@ -387,7 +387,7 @@ fn string_pad(
/// https://tc39.es/ecma262/#sec-string.prototype.padend /// https://tc39.es/ecma262/#sec-string.prototype.padend
pub fn pad_end(this: Value, _: Value, args: Vec<Value>) -> ResultValue { pub fn pad_end(this: Value, _: Value, args: Vec<Value>) -> ResultValue {
let primitive_val: String = let primitive_val: String =
from_value(this.get_private_field(String::from("PrimitiveValue"))).unwrap(); from_value(this.get_internal_slot("PrimitiveValue")).unwrap();
if args.len() < 1 { if args.len() < 1 {
return Err(to_value("padEnd requires maxLength argument")); return Err(to_value("padEnd requires maxLength argument"));
} }
@ -407,7 +407,7 @@ pub fn pad_end(this: Value, _: Value, args: Vec<Value>) -> ResultValue {
/// https://tc39.es/ecma262/#sec-string.prototype.padstart /// https://tc39.es/ecma262/#sec-string.prototype.padstart
pub fn pad_start(this: Value, _: Value, args: Vec<Value>) -> ResultValue { pub fn pad_start(this: Value, _: Value, args: Vec<Value>) -> ResultValue {
let primitive_val: String = let primitive_val: String =
from_value(this.get_private_field(String::from("PrimitiveValue"))).unwrap(); from_value(this.get_internal_slot("PrimitiveValue")).unwrap();
if args.len() < 1 { if args.len() < 1 {
return Err(to_value("padStart requires maxLength argument")); return Err(to_value("padStart requires maxLength argument"));
} }

Loading…
Cancel
Save