Reviewers: Lasse Reichstein,

Description:
Made function prototype property DontEnum for compatibility with
Safari.  Fixed const error in api.

Please review this at http://codereview.chromium.org/200056

Affected files:
   M include/v8.h
   M src/bootstrapper.cc
   M test/mjsunit/function-prototype.js


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index  
8cd49f8b29f1b2ac5c2d934da924064cc838631b..2789bad21646b84a81fe02402887817d91ffac49
  
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1024,8 +1024,8 @@ class V8EXPORT String : public Primitive {
     public:
      explicit Value(Handle<v8::Value> obj);
      ~Value();
-    uint16_t* operator*() const { return str_; }
-    const uint16_t* operator*() { return str_; }
+    uint16_t* operator*() { return str_; }
+    const uint16_t* operator*() const { return str_; }
      int length() const { return length_; }
     private:
      uint16_t* str_;
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index  
a2c45626bef6723ade2486902c838d68ae2ebbe9..c1daa57b1fa51753d4642bda21de3f23c60b58ac
  
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -474,7 +474,7 @@ void  
Genesis::CreateRoots(v8::Handle<v8::ObjectTemplate> global_template,
    // Please note that the prototype property for function instances must be
    // writable.
    Handle<DescriptorArray> function_map_descriptors =
-      ComputeFunctionInstanceDescriptor(false, true);
+      ComputeFunctionInstanceDescriptor(false, false);
    fm->set_instance_descriptors(*function_map_descriptors);

    // Allocate the function map first and then patch the prototype later
Index: test/mjsunit/function-prototype.js
diff --git a/test/mjsunit/function-prototype.js  
b/test/mjsunit/function-prototype.js
index  
371311e49ae1a238b5c64e3319ae0c4d2d7b79f5..91e098809881ee06a7c974c9a528513a0d8fd0f3
  
100644
--- a/test/mjsunit/function-prototype.js
+++ b/test/mjsunit/function-prototype.js
@@ -90,8 +90,8 @@ assertEquals(F.prototype, GetPrototypeOf(F));
  // in GetPrototypeOf and go to a monomorphic IC load instead.
  assertEquals(87, GetPrototypeOf({prototype:87}));

-// Check the prototype is enumerable as specified in ECMA262, 15.3.5.2
+// Check the prototype is not enumerable, for compatibility with safari
  var foo = new Function("return x");
  var result  = ""
  for (var n in foo) result += n;
-assertEquals(result, "prototype");
+assertEquals(result, "");



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to