Changeset 1799 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Aug 12, 2002, 1:14:02 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r1623 r1799 118 118 } 119 119 120 StatementNode::~StatementNode()121 {122 }123 124 120 void StatementNode::setLoc(int line0, int line1, int sourceId) 125 121 { … … 227 223 // ------------------------------ GroupNode ------------------------------------ 228 224 229 GroupNode::~GroupNode()230 {231 }232 233 225 void GroupNode::ref() 234 226 { … … 252 244 253 245 // ------------------------------ ElisionNode ---------------------------------- 254 255 ElisionNode::~ElisionNode()256 {257 }258 246 259 247 void ElisionNode::ref() … … 281 269 282 270 // ------------------------------ ElementNode ---------------------------------- 283 284 ElementNode::~ElementNode()285 {286 }287 271 288 272 void ElementNode::ref() … … 321 305 KJS_CHECKEXCEPTIONVALUE 322 306 val = node->evaluate(exec).getValue(exec); 323 length = array.get(exec, "length").toInt32(exec);307 length = array.get(exec,lengthPropertyName).toInt32(exec); 324 308 } else { 325 309 Value newArr = exec->interpreter()->builtinArray().construct(exec,List::empty()); … … 329 313 } 330 314 331 array.put(exec, UString::from(elisionLen + length), val);315 array.put(exec, elisionLen + length, val); 332 316 333 317 return array; … … 335 319 336 320 // ------------------------------ ArrayNode ------------------------------------ 337 338 ArrayNode::~ArrayNode()339 {340 }341 321 342 322 void ArrayNode::ref() … … 369 349 array = Object(static_cast<ObjectImp*>(element->evaluate(exec).imp())); 370 350 KJS_CHECKEXCEPTIONVALUE 371 length = opt ? array.get(exec, "length").toInt32(exec) : 0;351 length = opt ? array.get(exec,lengthPropertyName).toInt32(exec) : 0; 372 352 } else { 373 353 Value newArr = exec->interpreter()->builtinArray().construct(exec,List::empty()); … … 377 357 378 358 if (opt) 379 array.put(exec, "length", Number(elisionLen + length), DontEnum | DontDelete);359 array.put(exec,lengthPropertyName, Number(elisionLen + length), DontEnum | DontDelete); 380 360 381 361 return array; … … 383 363 384 364 // ------------------------------ ObjectLiteralNode ---------------------------- 385 386 ObjectLiteralNode::~ObjectLiteralNode()387 {388 }389 365 390 366 void ObjectLiteralNode::ref() … … 412 388 413 389 // ------------------------------ PropertyValueNode ---------------------------- 414 415 PropertyValueNode::~PropertyValueNode()416 {417 }418 390 419 391 void PropertyValueNode::ref() … … 479 451 // ------------------------------ AccessorNode1 -------------------------------- 480 452 481 AccessorNode1::~AccessorNode1()482 {483 }484 485 453 void AccessorNode1::ref() 486 454 { … … 511 479 Value v2 = e2.getValue(exec); 512 480 Object o = v1.toObject(exec); 481 unsigned i; 482 if (v2.toUInt32(i)) 483 return Reference(o, i); 513 484 String s = v2.toString(exec); 514 485 return Reference(o, s.value()); … … 516 487 517 488 // ------------------------------ AccessorNode2 -------------------------------- 518 519 AccessorNode2::~AccessorNode2()520 {521 }522 489 523 490 void AccessorNode2::ref() … … 553 520 ArgumentListNode::ArgumentListNode(ArgumentListNode *l, Node *e) 554 521 : list(l), expr(e) 555 {556 }557 558 ArgumentListNode::~ArgumentListNode()559 522 { 560 523 } … … 608 571 } 609 572 610 ArgumentsNode::~ArgumentsNode()611 {612 }613 614 573 void ArgumentsNode::ref() 615 574 { … … 644 603 645 604 // ECMA 11.2.2 646 647 NewExprNode::~NewExprNode()648 {649 }650 605 651 606 void NewExprNode::ref() … … 694 649 695 650 // ------------------------------ FunctionCallNode ----------------------------- 696 697 FunctionCallNode::~FunctionCallNode()698 {699 }700 651 701 652 void FunctionCallNode::ref() … … 788 739 // ------------------------------ PostfixNode ---------------------------------- 789 740 790 PostfixNode::~PostfixNode()791 {792 }793 794 741 void PostfixNode::ref() 795 742 { … … 824 771 // ------------------------------ DeleteNode ----------------------------------- 825 772 826 DeleteNode::~DeleteNode()827 {828 }829 830 773 void DeleteNode::ref() 831 774 { … … 847 790 Value e = expr->evaluate(exec); 848 791 KJS_CHECKEXCEPTIONVALUE 849 if (e.type() != ReferenceType) 850 return Boolean(true); 851 Value b = e.getBase(exec); 852 UString n = e.getPropertyName(exec); 853 854 // The spec doesn't mention what to do if the base is null... just return true 855 if (b.type() != ObjectType) { 856 assert(b.type() == NullType); 857 return Boolean(true); 858 } 859 860 Object o = Object(static_cast<ObjectImp*>(b.imp())); 861 862 bool ret = o.deleteProperty(exec,n); 863 864 return Boolean(ret); 792 return Boolean(e.deleteValue(exec)); 865 793 } 866 794 867 795 // ------------------------------ VoidNode ------------------------------------- 868 869 VoidNode::~VoidNode()870 {871 }872 796 873 797 void VoidNode::ref() … … 896 820 897 821 // ------------------------------ TypeOfNode ----------------------------------- 898 899 TypeOfNode::~TypeOfNode()900 {901 }902 822 903 823 void TypeOfNode::ref() … … 957 877 // ------------------------------ PrefixNode ----------------------------------- 958 878 959 PrefixNode::~PrefixNode()960 {961 }962 963 879 void PrefixNode::ref() 964 880 { … … 993 909 // ------------------------------ UnaryPlusNode -------------------------------- 994 910 995 UnaryPlusNode::~UnaryPlusNode()996 {997 }998 999 911 void UnaryPlusNode::ref() 1000 912 { … … 1023 935 // ------------------------------ NegateNode ----------------------------------- 1024 936 1025 NegateNode::~NegateNode()1026 {1027 }1028 1029 937 void NegateNode::ref() 1030 938 { … … 1056 964 // ------------------------------ BitwiseNotNode ------------------------------- 1057 965 1058 BitwiseNotNode::~BitwiseNotNode()1059 {1060 }1061 1062 966 void BitwiseNotNode::ref() 1063 967 { … … 1087 991 // ------------------------------ LogicalNotNode ------------------------------- 1088 992 1089 LogicalNotNode::~LogicalNotNode()1090 {1091 }1092 1093 993 void LogicalNotNode::ref() 1094 994 { … … 1117 1017 1118 1018 // ------------------------------ MultNode ------------------------------------- 1119 1120 MultNode::~MultNode()1121 {1122 }1123 1019 1124 1020 void MultNode::ref() … … 1156 1052 // ------------------------------ AddNode -------------------------------------- 1157 1053 1158 AddNode::~AddNode()1159 {1160 }1161 1162 1054 void AddNode::ref() 1163 1055 { … … 1193 1085 1194 1086 // ------------------------------ ShiftNode ------------------------------------ 1195 1196 ShiftNode::~ShiftNode()1197 {1198 }1199 1087 1200 1088 void ShiftNode::ref() … … 1248 1136 1249 1137 // ------------------------------ RelationalNode ------------------------------- 1250 1251 RelationalNode::~RelationalNode()1252 {1253 }1254 1138 1255 1139 void RelationalNode::ref() … … 1324 1208 // ------------------------------ EqualNode ------------------------------------ 1325 1209 1326 EqualNode::~EqualNode()1327 {1328 }1329 1330 1210 void EqualNode::ref() 1331 1211 { … … 1370 1250 1371 1251 // ------------------------------ BitOperNode ---------------------------------- 1372 1373 BitOperNode::~BitOperNode()1374 {1375 }1376 1252 1377 1253 void BitOperNode::ref() … … 1417 1293 // ------------------------------ BinaryLogicalNode ---------------------------- 1418 1294 1419 BinaryLogicalNode::~BinaryLogicalNode()1420 {1421 }1422 1423 1295 void BinaryLogicalNode::ref() 1424 1296 { … … 1457 1329 1458 1330 // ------------------------------ ConditionalNode ------------------------------ 1459 1460 ConditionalNode::~ConditionalNode()1461 {1462 }1463 1331 1464 1332 void ConditionalNode::ref() … … 1502 1370 1503 1371 // ------------------------------ AssignNode ----------------------------------- 1504 1505 AssignNode::~AssignNode()1506 {1507 }1508 1372 1509 1373 void AssignNode::ref() … … 1597 1461 // ------------------------------ CommaNode ------------------------------------ 1598 1462 1599 CommaNode::~CommaNode()1600 {1601 }1602 1603 1463 void CommaNode::ref() 1604 1464 { … … 1632 1492 1633 1493 // ------------------------------ StatListNode --------------------------------- 1634 1635 StatListNode::~StatListNode()1636 {1637 }1638 1494 1639 1495 void StatListNode::ref() … … 1698 1554 // ------------------------------ AssignExprNode ------------------------------- 1699 1555 1700 AssignExprNode::~AssignExprNode()1701 {1702 }1703 1704 1556 void AssignExprNode::ref() 1705 1557 { … … 1726 1578 VarDeclNode::VarDeclNode(const UString *id, AssignExprNode *in) 1727 1579 : ident(*id), init(in) 1728 {1729 }1730 1731 VarDeclNode::~VarDeclNode()1732 1580 { 1733 1581 } … … 1781 1629 // ------------------------------ VarDeclListNode ------------------------------ 1782 1630 1783 VarDeclListNode::~VarDeclListNode()1784 {1785 }1786 1787 1631 void VarDeclListNode::ref() 1788 1632 { … … 1827 1671 // ------------------------------ VarStatementNode ----------------------------- 1828 1672 1829 VarStatementNode::~VarStatementNode()1830 {1831 }1832 1833 1673 void VarStatementNode::ref() 1834 1674 { … … 1863 1703 // ------------------------------ BlockNode ------------------------------------ 1864 1704 1865 BlockNode::~BlockNode()1866 {1867 }1868 1869 1705 void BlockNode::ref() 1870 1706 { … … 1907 1743 1908 1744 // ------------------------------ ExprStatementNode ---------------------------- 1909 1910 ExprStatementNode::~ExprStatementNode()1911 {1912 }1913 1745 1914 1746 void ExprStatementNode::ref() … … 1939 1771 1940 1772 // ------------------------------ IfNode --------------------------------------- 1941 1942 IfNode::~IfNode()1943 {1944 }1945 1773 1946 1774 void IfNode::ref() … … 1997 1825 1998 1826 // ------------------------------ DoWhileNode ---------------------------------- 1999 2000 DoWhileNode::~DoWhileNode()2001 {2002 }2003 1827 2004 1828 void DoWhileNode::ref() … … 2055 1879 // ------------------------------ WhileNode ------------------------------------ 2056 1880 2057 WhileNode::~WhileNode()2058 {2059 }2060 2061 1881 void WhileNode::ref() 2062 1882 { … … 2118 1938 2119 1939 // ------------------------------ ForNode -------------------------------------- 2120 2121 ForNode::~ForNode()2122 {2123 }2124 1940 2125 1941 void ForNode::ref() … … 2212 2028 } 2213 2029 2214 ForInNode::~ForInNode()2215 {2216 }2217 2218 2030 void ForInNode::ref() 2219 2031 { … … 2333 2145 // ------------------------------ ReturnNode ----------------------------------- 2334 2146 2335 ReturnNode::~ReturnNode()2336 {2337 }2338 2339 2147 void ReturnNode::ref() 2340 2148 { … … 2367 2175 2368 2176 // ------------------------------ WithNode ------------------------------------- 2369 2370 WithNode::~WithNode()2371 {2372 }2373 2177 2374 2178 void WithNode::ref() … … 2414 2218 // ------------------------------ CaseClauseNode ------------------------------- 2415 2219 2416 CaseClauseNode::~CaseClauseNode()2417 {2418 }2419 2420 2220 void CaseClauseNode::ref() 2421 2221 { … … 2463 2263 // ------------------------------ ClauseListNode ------------------------------- 2464 2264 2465 ClauseListNode::~ClauseListNode()2466 {2467 }2468 2469 2265 void ClauseListNode::ref() 2470 2266 { … … 2512 2308 2513 2309 // ------------------------------ CaseBlockNode -------------------------------- 2514 2515 CaseBlockNode::~CaseBlockNode()2516 {2517 }2518 2310 2519 2311 void CaseBlockNode::ref() … … 2620 2412 // ------------------------------ SwitchNode ----------------------------------- 2621 2413 2622 SwitchNode::~SwitchNode()2623 {2624 }2625 2626 2414 void SwitchNode::ref() 2627 2415 { … … 2664 2452 2665 2453 // ------------------------------ LabelNode ------------------------------------ 2666 2667 LabelNode::~LabelNode()2668 {2669 }2670 2454 2671 2455 void LabelNode::ref() … … 2708 2492 // ------------------------------ ThrowNode ------------------------------------ 2709 2493 2710 ThrowNode::~ThrowNode()2711 {2712 }2713 2714 2494 void ThrowNode::ref() 2715 2495 { … … 2742 2522 2743 2523 // ------------------------------ CatchNode ------------------------------------ 2744 2745 CatchNode::~CatchNode()2746 {2747 }2748 2524 2749 2525 void CatchNode::ref() … … 2791 2567 // ------------------------------ FinallyNode ---------------------------------- 2792 2568 2793 FinallyNode::~FinallyNode()2794 {2795 }2796 2797 2569 void FinallyNode::ref() 2798 2570 { … … 2821 2593 2822 2594 // ------------------------------ TryNode -------------------------------------- 2823 2824 TryNode::~TryNode()2825 {2826 }2827 2595 2828 2596 void TryNode::ref() … … 2886 2654 // ------------------------------ ParameterNode -------------------------------- 2887 2655 2888 ParameterNode::~ParameterNode()2889 {2890 }2891 2892 2656 void ParameterNode::ref() 2893 2657 { … … 2931 2695 } 2932 2696 2933 FunctionBodyNode::~FunctionBodyNode()2934 {2935 //fprintf(stderr,"FunctionBodyNode::~FunctionBodyNode %p\n",this);2936 }2937 2938 2697 void FunctionBodyNode::ref() 2939 2698 { … … 2977 2736 2978 2737 // ------------------------------ FuncDeclNode --------------------------------- 2979 2980 FuncDeclNode::~FuncDeclNode()2981 {2982 }2983 2738 2984 2739 void FuncDeclNode::ref() … … 3012 2767 List empty; 3013 2768 Value proto = exec->interpreter()->builtinObject().construct(exec,empty); 3014 func.put(exec, "prototype", proto, Internal|DontDelete);2769 func.put(exec, prototypePropertyName, proto, Internal|DontDelete); 3015 2770 3016 2771 int plen = 0; … … 3018 2773 fimp->addParameter(p->ident()); 3019 2774 3020 func.put(exec, "length", Number(plen), ReadOnly|DontDelete|DontEnum);2775 func.put(exec, lengthPropertyName, Number(plen), ReadOnly|DontDelete|DontEnum); 3021 2776 3022 2777 exec->context().imp()->variableObject().put(exec,ident,func); … … 3036 2791 // ------------------------------ FuncExprNode --------------------------------- 3037 2792 3038 FuncExprNode::~FuncExprNode()3039 {3040 }3041 3042 2793 void FuncExprNode::ref() 3043 2794 { … … 3067 2818 List empty; 3068 2819 Value proto = exec->interpreter()->builtinObject().construct(exec,empty); 3069 fimp->put(exec, "prototype", proto, Internal|DontDelete);2820 fimp->put(exec, prototypePropertyName, proto, Internal|DontDelete); 3070 2821 3071 2822 int plen = 0; 3072 2823 for(ParameterNode *p = param; p != 0L; p = p->nextParam(), plen++) 3073 2824 fimp->addParameter(p->ident()); 3074 fimp->put(exec, "length", Number(plen), ReadOnly|DontDelete|DontEnum);2825 fimp->put(exec,lengthPropertyName, Number(plen), ReadOnly|DontDelete|DontEnum); 3075 2826 3076 2827 return ret; … … 3078 2829 3079 2830 // ------------------------------ SourceElementNode ---------------------------- 3080 3081 SourceElementNode::~SourceElementNode()3082 {3083 }3084 2831 3085 2832 void SourceElementNode::ref() … … 3124 2871 3125 2872 // ------------------------------ SourceElementsNode --------------------------- 3126 3127 SourceElementsNode::~SourceElementsNode()3128 {3129 }3130 2873 3131 2874 void SourceElementsNode::ref() … … 3188 2931 //fprintf(stderr,"ProgramNode::ProgramNode %p\n",this); 3189 2932 } 3190 3191 ProgramNode::~ProgramNode() {3192 //fprintf(stderr,"ProgramNode::~ProgramNode %p\n",this);3193 }
Note:
See TracChangeset
for help on using the changeset viewer.