Changeset 15473 in webkit for trunk/JavaScriptCore/API/minidom.js


Ignore:
Timestamp:
Jul 16, 2006, 6:48:27 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Maciej.


  • Properly document and handle NULL callbacks for static properties. We throw an exception in any case other than a ReadOnly property with a NULL setProperty callback, because a NULL callback almost certainly indicates a programming error. Also throw an exception if hasProperty returns true for a property that getProperty can't get.


  • If a static setProperty callback returns 'false', to indicate that the property was not set, we no longer forward the set request up the class chain, because that's almost certainly not what the programmer expected.
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::getOwnPropertySlot): (KJS::JSCallbackObject::put): (KJS::JSCallbackObject::staticValueGetter): (KJS::JSCallbackObject::staticFunctionGetter): (KJS::JSCallbackObject::callbackGetter):
  • API/JSObjectRef.h:
  • API/minidom.js:
  • API/testapi.c: (MyObject_hasProperty):
  • API/testapi.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/minidom.js

    r15133 r15473  
    166166}
    167167
     168function shouldBe(a, b)
     169{
     170    var evalA;
     171    try {
     172        evalA = eval(a);
     173    } catch(e) {
     174        evalA = e;
     175    }
     176   
     177    if (evalA == b || isNaN(evalA) && typeof evalA == 'number' && isNaN(b) && typeof b == 'number')
     178        print("PASS: " + a + " should be " + b + " and is.", "green");
     179    else
     180        print("__FAIL__: " + a + " should be " + b + " but instead is " + evalA + ".", "red");
     181}
     182
    168183function test()
    169184{
     
    222237        print("caught: " + e);
    223238    }
     239   
     240    oldNodeType = node.nodeType;
     241    node.nodeType = 1;
     242    shouldBe("node.nodeType", oldNodeType);
    224243
    225244    /*
Note: See TracChangeset for help on using the changeset viewer.