[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:24:27 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 7fde061946e6729e70a63fde507e5c6149bc00ad
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 12 20:11:36 2003 +0000

            Reviewed by Dave.
    
            - fixed 3145442 -- toString(16) is not working, causing non-ASCII characters in mac.com homepage to be munged
    
            * kjs/number_object.cpp: (NumberProtoFuncImp::call): Add handling for toString with a radix other than
            10 passed as an argument.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3640 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index b0f55aa..91c265c 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,12 @@
+2003-02-12  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+        - fixed 3145442 -- toString(16) is not working, causing non-ASCII characters in mac.com homepage to be munged
+
+        * kjs/number_object.cpp: (NumberProtoFuncImp::call): Add handling for toString with a radix other than
+        10 passed as an argument.
+
 2003-02-11  Trey Matteson  <trey at apple.com>
 
 	Set -seg1addr in our build styles, but not for the B&I build.
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index b0f55aa..91c265c 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,12 @@
+2003-02-12  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+        - fixed 3145442 -- toString(16) is not working, causing non-ASCII characters in mac.com homepage to be munged
+
+        * kjs/number_object.cpp: (NumberProtoFuncImp::call): Add handling for toString with a radix other than
+        10 passed as an argument.
+
 2003-02-11  Trey Matteson  <trey at apple.com>
 
 	Set -seg1addr in our build styles, but not for the B&I build.
diff --git a/JavaScriptCore/kjs/number_object.cpp b/JavaScriptCore/kjs/number_object.cpp
index 18e3418..29d59ac 100644
--- a/JavaScriptCore/kjs/number_object.cpp
+++ b/JavaScriptCore/kjs/number_object.cpp
@@ -77,7 +77,7 @@ bool NumberProtoFuncImp::implementsCall() const
 }
 
 // ECMA 15.7.4.2 - 15.7.4.7
-Value NumberProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &/*args*/)
+Value NumberProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
 {
   Value result;
 
@@ -91,7 +91,25 @@ Value NumberProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &/*a
   // execute "toString()" or "valueOf()", respectively
   Value v = thisObj.internalValue();
   switch (id) {
-  case ToString:
+  case ToString: {
+    int radix = 10;
+    if (!args.isEmpty() && args[0].type() != UndefinedType)
+      radix = args[0].toInteger(exec);
+    if (radix < 2 || radix > 36 || radix == 10)
+      result = String(v.toString(exec));
+    else {
+      unsigned i = v.toUInt32(exec);
+      char s[33];
+      char *p = s + sizeof(s);
+      *--p = '\0';
+      do {
+        *--p = "0123456789abcdefghijklmnopqrstuvwxyz"[i % radix];
+        i /= radix;
+      } while (i);
+      result = String(p);
+    }
+    break;
+  }
   case ToLocaleString: /* TODO */
     result = String(v.toString(exec));
     break;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list