[gjs] Format: don't call toString() blindly



commit 6aaa1f428425f0ca0e83912c9f432294faef147c
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Oct 25 19:04:25 2012 +0200

    Format: don't call toString() blindly
    
    Instead, use String() as a function. It fixes passing null or
    undefined to format().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687153

 modules/format.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/modules/format.js b/modules/format.js
index b903a06..56bce7d 100644
--- a/modules/format.js
+++ b/modules/format.js
@@ -28,7 +28,7 @@ function vprintf(str, args) {
             return '%';
             break;
         case 's':
-            s = args[i++].toString();
+            s = String(args[i++]);
             break;
         case 'd':
             let intV = parseInt(args[i++]);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]