From 3ce547d42723d9236c55bda42782dd9dc563485b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Borges?= Date: Sun, 27 Sep 2020 20:18:55 +0100 Subject: [PATCH] Add fast path for string concatenation (#723) --- boa/src/value/operations.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/boa/src/value/operations.rs b/boa/src/value/operations.rs index 143fabf7a4..b8c5153af9 100644 --- a/boa/src/value/operations.rs +++ b/boa/src/value/operations.rs @@ -11,6 +11,7 @@ impl Value { (Self::Integer(x), Self::Rational(y)) => Self::rational(f64::from(*x) + y), (Self::Rational(x), Self::Integer(y)) => Self::rational(x + f64::from(*y)), + (Self::String(ref x), Self::String(ref y)) => Self::string(format!("{}{}", x, y)), (Self::String(ref x), ref y) => Self::string(format!("{}{}", x, y.to_string(ctx)?)), (ref x, Self::String(ref y)) => Self::string(format!("{}{}", x.to_string(ctx)?, y)), (Self::BigInt(ref n1), Self::BigInt(ref n2)) => {