[webkit-changes] cvs commit: LayoutTests/fast/js
for-in-expected.txt for-in.html
Maciej
mjs at opensource.apple.com
Wed Oct 5 01:05:45 PDT 2005
mjs 05/10/05 01:05:44
Modified: . ChangeLog
JavaScriptCore.xcodeproj project.pbxproj
kjs array_instance.h array_object.cpp nodes.cpp nodes.h
object.cpp object.h property_map.cpp property_map.h
protect.h ustring.h
kxmlcore HashSet.h
. ChangeLog
Added: kjs IdentifierSequencedSet.cpp IdentifierSequencedSet.h
fast/js for-in-expected.txt for-in.html
Removed: kjs protected_reference.h reference.cpp reference.h
reference_list.cpp reference_list.h
Log:
JavaScriptCore:
Reviewed by Eric.
- fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
Also fixed some bugs with for..in enumeration while I was at it. object
properties now come before prototype properties and duplicates
between object and prototype are listed only once.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/IdentifierSequencedSet.cpp: Added.
(KJS::IdentifierSequencedSet::IdentifierSequencedSet):
(KJS::IdentifierSequencedSet::deallocateVector):
(KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
(KJS::IdentifierSequencedSet::insert):
* kjs/IdentifierSequencedSet.h: Added.
(KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
(KJS::IdentifierSequencedSetIterator::operator*):
(KJS::IdentifierSequencedSetIterator::operator->):
(KJS::IdentifierSequencedSetIterator::operator++):
(KJS::IdentifierSequencedSetIterator::operator==):
(KJS::IdentifierSequencedSetIterator::operator!=):
(KJS::IdentifierSequencedSet::begin):
(KJS::IdentifierSequencedSet::end):
(KJS::IdentifierSequencedSet::size):
* kjs/array_instance.h:
* kjs/array_object.cpp:
(ArrayInstanceImp::getPropertyNames):
(ArrayInstanceImp::setLength):
(ArrayInstanceImp::pushUndefinedObjectsToEnd):
* kjs/nodes.cpp:
(ForInNode::execute):
* kjs/nodes.h:
* kjs/object.cpp:
(KJS::ObjectImp::getPropertyNames):
* kjs/object.h:
* kjs/property_map.cpp:
(KJS::PropertyMap::getEnumerablePropertyNames):
(KJS::PropertyMap::getSparseArrayPropertyNames):
* kjs/property_map.h:
* kjs/protect.h:
* kjs/protected_reference.h: Removed.
* kjs/reference.cpp: Removed.
* kjs/reference.h: Removed.
* kjs/reference_list.cpp: Removed.
* kjs/reference_list.h: Removed.
* kjs/ustring.h:
(KJS::UString::impl):
* kxmlcore/HashSet.h:
LayoutTests:
Reviewed by Eric.
- test case for some fixes I made to for..in enumeration. object
properties now come before prototype properties and duplicates
between object and prototype are listed only once.
* fast/js/for-in-expected.txt: Added.
* fast/js/for-in.html: Added.
Revision Changes Path
1.854 +51 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.853
retrieving revision 1.854
diff -u -r1.853 -r1.854
--- ChangeLog 4 Oct 2005 09:33:31 -0000 1.853
+++ ChangeLog 5 Oct 2005 08:05:33 -0000 1.854
@@ -1,3 +1,54 @@
+2005-10-05 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Eric.
+
+ - fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
+
+ Also fixed some bugs with for..in enumeration while I was at it. object
+ properties now come before prototype properties and duplicates
+ between object and prototype are listed only once.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * kjs/IdentifierSequencedSet.cpp: Added.
+ (KJS::IdentifierSequencedSet::IdentifierSequencedSet):
+ (KJS::IdentifierSequencedSet::deallocateVector):
+ (KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
+ (KJS::IdentifierSequencedSet::insert):
+ * kjs/IdentifierSequencedSet.h: Added.
+ (KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
+ (KJS::IdentifierSequencedSetIterator::operator*):
+ (KJS::IdentifierSequencedSetIterator::operator->):
+ (KJS::IdentifierSequencedSetIterator::operator++):
+ (KJS::IdentifierSequencedSetIterator::operator==):
+ (KJS::IdentifierSequencedSetIterator::operator!=):
+ (KJS::IdentifierSequencedSet::begin):
+ (KJS::IdentifierSequencedSet::end):
+ (KJS::IdentifierSequencedSet::size):
+ * kjs/array_instance.h:
+ * kjs/array_object.cpp:
+ (ArrayInstanceImp::getPropertyNames):
+ (ArrayInstanceImp::setLength):
+ (ArrayInstanceImp::pushUndefinedObjectsToEnd):
+ * kjs/nodes.cpp:
+ (ForInNode::execute):
+ * kjs/nodes.h:
+ * kjs/object.cpp:
+ (KJS::ObjectImp::getPropertyNames):
+ * kjs/object.h:
+ * kjs/property_map.cpp:
+ (KJS::PropertyMap::getEnumerablePropertyNames):
+ (KJS::PropertyMap::getSparseArrayPropertyNames):
+ * kjs/property_map.h:
+ * kjs/protect.h:
+ * kjs/protected_reference.h: Removed.
+ * kjs/reference.cpp: Removed.
+ * kjs/reference.h: Removed.
+ * kjs/reference_list.cpp: Removed.
+ * kjs/reference_list.h: Removed.
+ * kjs/ustring.h:
+ (KJS::UString::impl):
+ * kxmlcore/HashSet.h:
+
2005-10-04 Eric Seidel <eseidel at apple.com>
Reviewed by mjs.
1.18 +12 -30 JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Index: project.pbxproj
===================================================================
RCS file: /cvs/root/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- project.pbxproj 3 Oct 2005 21:11:41 -0000 1.17
+++ project.pbxproj 5 Oct 2005 08:05:36 -0000 1.18
@@ -32,9 +32,10 @@
37B800EF08EBB65B0035B474 /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DFC92D08EA173A00F7300B /* HashTable.cpp */; };
37B800F008EBB65B0035B474 /* HashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92E08EA173A00F7300B /* HashTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
37B800F108EBB65C0035B474 /* HashTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92F08EA173A00F7300B /* HashTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 6512E62B08F3BA8B004A15B6 /* IdentifierSequencedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 6512E63608F3BADE004A15B6 /* IdentifierSequencedSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */; };
65162EEB08E6A1FE007556CD /* SharedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65162EEA08E6A1FE007556CD /* SharedPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
65162F0208E6A2D0007556CD /* SharedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65162EEA08E6A1FE007556CD /* SharedPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 652C107F08DA7B1E0020887D /* protected_reference.h in Headers */ = {isa = PBXBuildFile; fileRef = 652C107E08DA7B1E0020887D /* protected_reference.h */; };
6541BD7208E80A17002CBEE7 /* TCPageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6E08E80A17002CBEE7 /* TCPageMap.h */; };
6541BD7308E80A17002CBEE7 /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */; };
6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */; };
@@ -44,6 +45,8 @@
65621E6E089E859700760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
65621E6F089E85D300760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
65621E70089E85D300760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 65D6D61D08F2676800958B28 /* IdentifierSequencedSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */; };
+ 65D6D61E08F2676800958B28 /* IdentifierSequencedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
65D7D19C08F10B5B0015ABD8 /* FastMallocInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D7D19B08F10B5B0015ABD8 /* FastMallocInternal.h */; };
65DFC93008EA173A00F7300B /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92A08EA173A00F7300B /* HashFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; };
65DFC93108EA173A00F7300B /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92B08EA173A00F7300B /* HashMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -92,8 +95,6 @@
932F5B600822A1C700736975 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F68EBB8C0255D4C601FF60F7 /* config.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B610822A1C700736975 /* JavaScriptCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */; };
932F5B620822A1C700736975 /* simple_number.h in Headers */ = {isa = PBXBuildFile; fileRef = F50888B6030BB74C012A967E /* simple_number.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 932F5B630822A1C700736975 /* reference_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F54F0800030CD22001B5C2EB /* reference_list.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 932F5B640822A1C700736975 /* reference.h in Headers */ = {isa = PBXBuildFile; fileRef = F5341391030CEEB1018BE7F3 /* reference.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B650822A1C700736975 /* completion.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BB2BC5030F772101FCFE1D /* completion.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B660822A1C700736975 /* identifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A349A038AE7C6008635CE /* identifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B670822A1C700736975 /* array_instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 938772E5038BFE19008635CE /* array_instance.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -158,8 +159,6 @@
932F5BA80822A1C700736975 /* ustring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8850255597D01FF60F7 /* ustring.cpp */; };
932F5BA90822A1C700736975 /* value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8870255597D01FF60F7 /* value.cpp */; };
932F5BAB0822A1C700736975 /* nodes2string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5FFE656026B47A6018635CA /* nodes2string.cpp */; };
- 932F5BAC0822A1C700736975 /* reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341390030CEEB1018BE7F3 /* reference.cpp */; settings = {ATTRIBUTES = (Private, ); }; };
- 932F5BAD0822A1C700736975 /* reference_list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341394030CF5F8018BE7F3 /* reference_list.cpp */; settings = {ATTRIBUTES = (Private, ); }; };
932F5BAE0822A1C700736975 /* identifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933A349D038AE80F008635CE /* identifier.cpp */; };
932F5BAF0822A1C700736975 /* scope_chain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9374D3A8038D9D74008635CE /* scope_chain.cpp */; };
932F5BB00822A1C700736975 /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 931C6CF0038EE8DE008635CE /* list.cpp */; };
@@ -248,8 +247,6 @@
A85D8210087B2822006A9172 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F68EBB8C0255D4C601FF60F7 /* config.h */; settings = {ATTRIBUTES = (Private, ); }; };
A85D8211087B2822006A9172 /* JavaScriptCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */; };
A85D8212087B2822006A9172 /* simple_number.h in Headers */ = {isa = PBXBuildFile; fileRef = F50888B6030BB74C012A967E /* simple_number.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A85D8213087B2822006A9172 /* reference_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F54F0800030CD22001B5C2EB /* reference_list.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A85D8214087B2822006A9172 /* reference.h in Headers */ = {isa = PBXBuildFile; fileRef = F5341391030CEEB1018BE7F3 /* reference.h */; settings = {ATTRIBUTES = (Private, ); }; };
A85D8215087B2822006A9172 /* completion.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BB2BC5030F772101FCFE1D /* completion.h */; settings = {ATTRIBUTES = (Private, ); }; };
A85D8216087B2822006A9172 /* identifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A349A038AE7C6008635CE /* identifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
A85D8217087B2822006A9172 /* array_instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 938772E5038BFE19008635CE /* array_instance.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -316,8 +313,6 @@
A85D8258087B2822006A9172 /* ustring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8850255597D01FF60F7 /* ustring.cpp */; };
A85D8259087B2822006A9172 /* value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8870255597D01FF60F7 /* value.cpp */; };
A85D825A087B2822006A9172 /* nodes2string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5FFE656026B47A6018635CA /* nodes2string.cpp */; };
- A85D825B087B2822006A9172 /* reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341390030CEEB1018BE7F3 /* reference.cpp */; settings = {ATTRIBUTES = (Private, ); }; };
- A85D825C087B2822006A9172 /* reference_list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5341394030CF5F8018BE7F3 /* reference_list.cpp */; settings = {ATTRIBUTES = (Private, ); }; };
A85D825D087B2822006A9172 /* identifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933A349D038AE80F008635CE /* identifier.cpp */; };
A85D825E087B2822006A9172 /* scope_chain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9374D3A8038D9D74008635CE /* scope_chain.cpp */; };
A85D825F087B2822006A9172 /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 931C6CF0038EE8DE008635CE /* list.cpp */; };
@@ -362,7 +357,6 @@
A883C7F408EA12860051473E /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */; };
A883C7F508EA12860051473E /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */; };
A883C7F608EA12860051473E /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */; };
- A883C7F708EA12A20051473E /* protected_reference.h in Headers */ = {isa = PBXBuildFile; fileRef = 652C107E08DA7B1E0020887D /* protected_reference.h */; };
A8BC0DFC08D43D6D00379918 /* ucptable.c in Headers */ = {isa = PBXBuildFile; fileRef = 93E26C0D08B1520900F85226 /* ucptable.c */; };
/* End PBXBuildFile section */
@@ -502,7 +496,6 @@
65162EEA08E6A1FE007556CD /* SharedPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SharedPtr.h; sourceTree = "<group>"; };
651F6412039D5B5F0078395C /* dtoa.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dtoa.cpp; sourceTree = "<group>"; };
651F6413039D5B5F0078395C /* dtoa.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dtoa.h; sourceTree = "<group>"; };
- 652C107E08DA7B1E0020887D /* protected_reference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protected_reference.h; sourceTree = "<group>"; };
6541720E039E08B90058BFEB /* dftables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dftables.c; path = pcre/dftables.c; sourceTree = "<group>"; };
6541720F039E08B90058BFEB /* pcre.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pcre.h; path = pcre/pcre.h; sourceTree = "<group>"; };
65417217039E0B280058BFEB /* pcre-config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "pcre-config.h"; path = "pcre/pcre-config.h"; sourceTree = "<group>"; };
@@ -516,6 +509,8 @@
65621E6B089E859700760F35 /* property_slot.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = property_slot.cpp; sourceTree = "<group>"; };
65621E6C089E859700760F35 /* property_slot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = property_slot.h; sourceTree = "<group>"; };
65C02FBB0637462A003E7EE6 /* protect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protect.h; sourceTree = "<group>"; };
+ 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IdentifierSequencedSet.cpp; sourceTree = "<group>"; };
+ 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IdentifierSequencedSet.h; sourceTree = "<group>"; };
65D7D19B08F10B5B0015ABD8 /* FastMallocInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FastMallocInternal.h; sourceTree = "<group>"; };
65DFC92A08EA173A00F7300B /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = "<group>"; };
65DFC92B08EA173A00F7300B /* HashMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashMap.h; sourceTree = "<group>"; };
@@ -572,10 +567,6 @@
93F1981A08245AAE001E9ABC /* keywords.table */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = keywords.table; sourceTree = "<group>"; };
A85D8288087B2822006A9172 /* JavaScriptCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F50888B6030BB74C012A967E /* simple_number.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = simple_number.h; sourceTree = "<group>"; };
- F5341390030CEEB1018BE7F3 /* reference.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reference.cpp; sourceTree = "<group>"; };
- F5341391030CEEB1018BE7F3 /* reference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = reference.h; sourceTree = "<group>"; };
- F5341394030CF5F8018BE7F3 /* reference_list.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reference_list.cpp; sourceTree = "<group>"; };
- F54F0800030CD22001B5C2EB /* reference_list.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = reference_list.h; sourceTree = "<group>"; };
F5BB2BC5030F772101FCFE1D /* completion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = completion.h; sourceTree = "<group>"; };
F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JavaScriptCorePrefix.h; path = ../JavaScriptCorePrefix.h; sourceTree = "<group>"; };
F5FFE656026B47A6018635CA /* nodes2string.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = nodes2string.cpp; sourceTree = "<group>"; };
@@ -714,11 +705,12 @@
08FB77AEFE84172EC02AAC07 /* Classes */ = {
isa = PBXGroup;
children = (
+ 65D6D61B08F2676800958B28 /* IdentifierSequencedSet.cpp */,
+ 65D6D61C08F2676800958B28 /* IdentifierSequencedSet.h */,
65621E6B089E859700760F35 /* property_slot.cpp */,
65621E6C089E859700760F35 /* property_slot.h */,
938772E5038BFE19008635CE /* array_instance.h */,
650B68D80639033F009D42DE /* protected_values.cpp */,
- 652C107E08DA7B1E0020887D /* protected_reference.h */,
650B68D90639033F009D42DE /* protected_values.h */,
F692A84E0255597D01FF60F7 /* array_object.h */,
F692A84D0255597D01FF60F7 /* array_object.cpp */,
@@ -765,10 +757,6 @@
F692A87A0255597D01FF60F7 /* property_map.h */,
F692A8790255597D01FF60F7 /* property_map.cpp */,
65C02FBB0637462A003E7EE6 /* protect.h */,
- F5341390030CEEB1018BE7F3 /* reference.cpp */,
- F5341391030CEEB1018BE7F3 /* reference.h */,
- F54F0800030CD22001B5C2EB /* reference_list.h */,
- F5341394030CF5F8018BE7F3 /* reference_list.cpp */,
F692A87B0255597D01FF60F7 /* regexp_object.cpp */,
F692A87C0255597D01FF60F7 /* regexp_object.h */,
F692A87D0255597D01FF60F7 /* regexp.cpp */,
@@ -971,8 +959,6 @@
932F5B600822A1C700736975 /* config.h in Headers */,
932F5B610822A1C700736975 /* JavaScriptCorePrefix.h in Headers */,
932F5B620822A1C700736975 /* simple_number.h in Headers */,
- 932F5B630822A1C700736975 /* reference_list.h in Headers */,
- 932F5B640822A1C700736975 /* reference.h in Headers */,
932F5B650822A1C700736975 /* completion.h in Headers */,
932F5B660822A1C700736975 /* identifier.h in Headers */,
932F5B670822A1C700736975 /* array_instance.h in Headers */,
@@ -1019,7 +1005,6 @@
93E26BFE08B151D400F85226 /* ucpinternal.h in Headers */,
93E26C1308B1523D00F85226 /* ucptable.c in Headers */,
93E26CCF08B2921900F85226 /* softlinking.h in Headers */,
- 652C107F08DA7B1E0020887D /* protected_reference.h in Headers */,
65162EEB08E6A1FE007556CD /* SharedPtr.h in Headers */,
65E217BD08E7EECC0023E5F6 /* Assertions.h in Headers */,
65E217C008E7EECC0023E5F6 /* FastMalloc.h in Headers */,
@@ -1033,6 +1018,7 @@
65DFC93508EA173A00F7300B /* HashTraits.h in Headers */,
6557E8F808EA5D4D0049CDFC /* HashMapPtrSpec.h in Headers */,
65D7D19C08F10B5B0015ABD8 /* FastMallocInternal.h in Headers */,
+ 65D6D61E08F2676800958B28 /* IdentifierSequencedSet.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1068,8 +1054,6 @@
A85D8210087B2822006A9172 /* config.h in Headers */,
A85D8211087B2822006A9172 /* JavaScriptCorePrefix.h in Headers */,
A85D8212087B2822006A9172 /* simple_number.h in Headers */,
- A85D8213087B2822006A9172 /* reference_list.h in Headers */,
- A85D8214087B2822006A9172 /* reference.h in Headers */,
A85D8215087B2822006A9172 /* completion.h in Headers */,
A85D8216087B2822006A9172 /* identifier.h in Headers */,
A85D8217087B2822006A9172 /* array_instance.h in Headers */,
@@ -1122,13 +1106,13 @@
A883C7F308EA12860051473E /* TCPageMap.h in Headers */,
A883C7F408EA12860051473E /* TCSpinLock.h in Headers */,
A883C7F608EA12860051473E /* TCSystemAlloc.h in Headers */,
- A883C7F708EA12A20051473E /* protected_reference.h in Headers */,
37B800EB08EBB6520035B474 /* HashFunctions.h in Headers */,
37B800EC08EBB6540035B474 /* HashMap.h in Headers */,
37B800ED08EBB6540035B474 /* HashMapPtrSpec.h in Headers */,
37B800EE08EBB65A0035B474 /* HashSet.h in Headers */,
37B800F008EBB65B0035B474 /* HashTable.h in Headers */,
37B800F108EBB65C0035B474 /* HashTraits.h in Headers */,
+ 6512E62B08F3BA8B004A15B6 /* IdentifierSequencedSet.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1641,8 +1625,6 @@
932F5BA80822A1C700736975 /* ustring.cpp in Sources */,
932F5BA90822A1C700736975 /* value.cpp in Sources */,
932F5BAB0822A1C700736975 /* nodes2string.cpp in Sources */,
- 932F5BAC0822A1C700736975 /* reference.cpp in Sources */,
- 932F5BAD0822A1C700736975 /* reference_list.cpp in Sources */,
932F5BAE0822A1C700736975 /* identifier.cpp in Sources */,
932F5BAF0822A1C700736975 /* scope_chain.cpp in Sources */,
932F5BB00822A1C700736975 /* list.cpp in Sources */,
@@ -1689,6 +1671,7 @@
65E217BF08E7EECC0023E5F6 /* FastMalloc.cpp in Sources */,
6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */,
65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */,
+ 65D6D61D08F2676800958B28 /* IdentifierSequencedSet.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1738,8 +1721,6 @@
A85D8258087B2822006A9172 /* ustring.cpp in Sources */,
A85D8259087B2822006A9172 /* value.cpp in Sources */,
A85D825A087B2822006A9172 /* nodes2string.cpp in Sources */,
- A85D825B087B2822006A9172 /* reference.cpp in Sources */,
- A85D825C087B2822006A9172 /* reference_list.cpp in Sources */,
A85D825D087B2822006A9172 /* identifier.cpp in Sources */,
A85D825E087B2822006A9172 /* scope_chain.cpp in Sources */,
A85D825F087B2822006A9172 /* list.cpp in Sources */,
@@ -1786,6 +1767,7 @@
A883C7F008EA12860051473E /* FastMalloc.cpp in Sources */,
A883C7F508EA12860051473E /* TCSystemAlloc.cpp in Sources */,
37B800EF08EBB65B0035B474 /* HashTable.cpp in Sources */,
+ 6512E63608F3BADE004A15B6 /* IdentifierSequencedSet.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1.17 +1 -1 JavaScriptCore/kjs/array_instance.h
Index: array_instance.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/array_instance.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- array_instance.h 8 Aug 2005 04:07:27 -0000 1.16
+++ array_instance.h 5 Oct 2005 08:05:37 -0000 1.17
@@ -39,7 +39,7 @@
virtual void put(ExecState *exec, unsigned propertyName, ValueImp *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
- virtual ReferenceList propList(ExecState *exec, bool recursive);
+ virtual void getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames);
virtual void mark();
1.53 +24 -27 JavaScriptCore/kjs/array_object.cpp
Index: array_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/array_object.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- array_object.cpp 3 Oct 2005 21:11:48 -0000 1.52
+++ array_object.cpp 5 Oct 2005 08:05:37 -0000 1.53
@@ -28,9 +28,9 @@
#include "interpreter.h"
#include "object.h"
#include "operations.h"
-#include "reference_list.h"
#include "types.h"
#include "value.h"
+#include "IdentifierSequencedSet.h"
#include "array_object.lut.h"
@@ -185,20 +185,18 @@
return ObjectImp::deleteProperty(exec, Identifier::from(index));
}
-ReferenceList ArrayInstanceImp::propList(ExecState *exec, bool recursive)
+void ArrayInstanceImp::getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames)
{
- ReferenceList properties = ObjectImp::propList(exec,recursive);
-
// avoid fetching this every time through the loop
ValueImp *undefined = jsUndefined();
for (unsigned i = 0; i < storageLength; ++i) {
ValueImp *imp = storage[i];
- if (imp && imp != undefined) {
- properties.append(Reference(this, i));
- }
+ if (imp && imp != undefined)
+ propertyNames.insert(Identifier::from(i));
}
- return properties;
+
+ ObjectImp::getPropertyNames(exec, propertyNames);
}
void ArrayInstanceImp::resizeStorage(unsigned newLength)
@@ -230,18 +228,18 @@
}
if (newLength < length) {
- ReferenceList sparseProperties;
+ IdentifierSequencedSet sparseProperties;
- _prop.addSparseArrayPropertiesToReferenceList(sparseProperties, this);
+ _prop.getSparseArrayPropertyNames(sparseProperties);
+
+ IdentifierSequencedSetIterator end = sparseProperties.end();
- ReferenceListIterator it = sparseProperties.begin();
- while (it != sparseProperties.end()) {
- Reference ref = it++;
+ for (IdentifierSequencedSetIterator it = sparseProperties.begin(); it != end; ++it) {
+ Identifier name = *it;
bool ok;
- unsigned index = ref.getPropertyName(exec).toArrayIndex(&ok);
- if (ok && index > newLength) {
- ref.deleteValue(exec);
- }
+ unsigned index = name.toArrayIndex(&ok);
+ if (ok && index > newLength)
+ deleteProperty(exec, name);
}
}
@@ -348,19 +346,18 @@
}
}
- ReferenceList sparseProperties;
- _prop.addSparseArrayPropertiesToReferenceList(sparseProperties, this);
- unsigned newLength = o + sparseProperties.length();
+ IdentifierSequencedSet sparseProperties;
+ _prop.getSparseArrayPropertyNames(sparseProperties);
+ unsigned newLength = o + sparseProperties.size();
- if (newLength > storageLength) {
+ if (newLength > storageLength)
resizeStorage(newLength);
- }
- ReferenceListIterator it = sparseProperties.begin();
- while (it != sparseProperties.end()) {
- Reference ref = it++;
- storage[o] = ref.getValue(exec);
- ObjectImp::deleteProperty(exec, ref.getPropertyName(exec));
+ IdentifierSequencedSetIterator end = sparseProperties.end();
+ for (IdentifierSequencedSetIterator it = sparseProperties.begin(); it != end; ++it) {
+ Identifier name = *it;
+ storage[o] = get(exec, name);
+ ObjectImp::deleteProperty(exec, name);
o++;
}
1.86 +7 -12 JavaScriptCore/kjs/nodes.cpp
Index: nodes.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/nodes.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- nodes.cpp 3 Oct 2005 21:11:49 -0000 1.85
+++ nodes.cpp 5 Oct 2005 08:05:37 -0000 1.86
@@ -43,7 +43,7 @@
#include "lexer.h"
#include "operations.h"
#include "ustring.h"
-#include "reference_list.h"
+#include "IdentifierSequencedSet.h"
using namespace KJS;
@@ -1780,7 +1780,7 @@
ValueImp *retval = 0;
ObjectImp *v;
Completion c;
- ReferenceList propList;
+ IdentifierSequencedSet propertyNames;
if (varDecl) {
varDecl->evaluate(exec);
@@ -1799,16 +1799,13 @@
KJS_CHECKEXCEPTION
v = e->toObject(exec);
- propList = v->propList(exec);
+ v->getPropertyNames(exec, propertyNames);
- ReferenceListIterator propIt = propList.begin();
-
- while (propIt != propList.end()) {
- Identifier name = propIt->getPropertyName(exec);
- if (!v->hasProperty(exec, name)) {
- propIt++;
+ IdentifierSequencedSetIterator end = propertyNames.end();
+ for (IdentifierSequencedSetIterator it = propertyNames.begin(); it != end; ++it) {
+ const Identifier &name = *it;
+ if (!v->hasProperty(exec, name))
continue;
- }
ValueImp *str = jsString(name.ustring());
@@ -1870,8 +1867,6 @@
return c;
}
}
-
- propIt++;
}
// bail out on error
1.39 +0 -1 JavaScriptCore/kjs/nodes.h
Index: nodes.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/nodes.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- nodes.h 3 Oct 2005 21:11:50 -0000 1.38
+++ nodes.h 5 Oct 2005 08:05:38 -0000 1.39
@@ -34,7 +34,6 @@
class ProgramNode;
class PropertyNode;
class PropertyValueNode;
- class Reference;
class RegExp;
class SourceElementsNode;
class SourceStream;
1.54 +7 -10 JavaScriptCore/kjs/object.cpp
Index: object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- object.cpp 4 Oct 2005 09:33:33 -0000 1.53
+++ object.cpp 5 Oct 2005 08:05:38 -0000 1.54
@@ -28,7 +28,7 @@
#include "types.h"
#include "interpreter.h"
#include "lookup.h"
-#include "reference_list.h"
+#include "IdentifierSequencedSet.h"
#include <assert.h>
#include <math.h>
@@ -374,13 +374,9 @@
return false;
}
-ReferenceList ObjectImp::propList(ExecState *exec, bool recursive)
+void ObjectImp::getPropertyNames(ExecState *exec, IdentifierSequencedSet &propertyNames)
{
- ReferenceList list;
- if (_proto->isObject() && recursive)
- list = static_cast<ObjectImp*>(_proto)->propList(exec,recursive);
-
- _prop.addEnumerablesToReferenceList(list, this);
+ _prop.getEnumerablePropertyNames(propertyNames);
// Add properties from the static hashtable of properties
const ClassInfo *info = classInfo();
@@ -389,14 +385,15 @@
int size = info->propHashTable->size;
const HashEntry *e = info->propHashTable->entries;
for (int i = 0; i < size; ++i, ++e) {
- if ( e->s && !(e->attr & DontEnum) )
- list.append(Reference(this, e->s)); /// ######### check for duplicates with the propertymap
+ if (e->s && !(e->attr & DontEnum))
+ propertyNames.insert(e->s);
}
}
info = info->parentClass;
}
- return list;
+ if (_proto->isObject())
+ static_cast<ObjectImp*>(_proto)->getPropertyNames(exec, propertyNames);
}
ValueImp *ObjectImp::toPrimitive(ExecState *exec, Type preferredType) const
1.46 +3 -5 JavaScriptCore/kjs/object.h
Index: object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- object.h 16 Aug 2005 00:47:26 -0000 1.45
+++ object.h 5 Oct 2005 08:05:38 -0000 1.46
@@ -47,6 +47,7 @@
class HashTable;
class HashEntry;
class ListImp;
+ class IdentifierSequencedSet;
// ECMA 262-3 8.6.1
// Property attributes
@@ -422,12 +423,9 @@
* having extra properties other than those set specifically with put().
*
* @param exec The current execution state
- * @param recursive Whether or not properties in the object's prototype
- * chain should be
- * included in the list.
- * @return A List of References to properties of the object.
+ * @param propertyNames A list of property names to be filled in by this call
**/
- virtual ReferenceList propList(ExecState *exec, bool recursive = true);
+ virtual void getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames);
/**
* Returns the internal value of the object. This is used for objects such
1.51 +12 -10 JavaScriptCore/kjs/property_map.cpp
Index: property_map.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/property_map.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- property_map.cpp 3 Oct 2005 21:11:50 -0000 1.50
+++ property_map.cpp 5 Oct 2005 08:05:38 -0000 1.51
@@ -25,7 +25,7 @@
#include <kxmlcore/FastMalloc.h>
#include "object.h"
#include "protect.h"
-#include "reference_list.h"
+#include "IdentifierSequencedSet.h"
#include <algorithm>
@@ -74,7 +74,7 @@
#endif
// lastIndexUsed is an ever-increasing index used to identify the order items
-// were inserted into the property map. It's vital that addEnumerablesToReferenceList
+// were inserted into the property map. It's vital that getEnumerablePropertyNames
// return the properties in the order they were added for compatibility with other
// browsers' JavaScript implementations.
struct PropertyMapHashTable
@@ -566,13 +566,13 @@
return 0;
}
-void PropertyMap::addEnumerablesToReferenceList(ReferenceList &list, ObjectImp *base) const
+void PropertyMap::getEnumerablePropertyNames(IdentifierSequencedSet& propertyNames) const
{
if (!_table) {
#if USE_SINGLE_ENTRY
UString::Rep *key = _singleEntry.key;
if (key && !(_singleEntry.attributes & DontEnum))
- list.append(Reference(base, Identifier(key)));
+ propertyNames.insert(Identifier(key));
#endif
return;
}
@@ -598,17 +598,19 @@
// Sort the entries by index.
qsort(sortedEnumerables, p - sortedEnumerables, sizeof(sortedEnumerables[0]), comparePropertyMapEntryIndices);
- // Put the keys of the sorted entries into the reference list.
+ // Put the keys of the sorted entries into the list.
Entry **q = sortedEnumerables;
- while (q != p)
- list.append(Reference(base, Identifier((*q++)->key)));
+ while (q != p) {
+ propertyNames.insert(Identifier(q[0]->key));
+ ++q;
+ }
// Deallocate the buffer.
if (sortedEnumerables != fixedSizeBuffer)
delete [] sortedEnumerables;
}
-void PropertyMap::addSparseArrayPropertiesToReferenceList(ReferenceList &list, ObjectImp *base) const
+void PropertyMap::getSparseArrayPropertyNames(IdentifierSequencedSet& propertyNames) const
{
if (!_table) {
#if USE_SINGLE_ENTRY
@@ -618,7 +620,7 @@
bool fitsInUInt32;
k.toUInt32(&fitsInUInt32);
if (fitsInUInt32)
- list.append(Reference(base, Identifier(key)));
+ propertyNames.insert(Identifier(key));
}
#endif
return;
@@ -633,7 +635,7 @@
bool fitsInUInt32;
k.toUInt32(&fitsInUInt32);
if (fitsInUInt32)
- list.append(Reference(base, Identifier(key)));
+ propertyNames.insert(Identifier(key));
}
}
}
1.25 +3 -3 JavaScriptCore/kjs/property_map.h
Index: property_map.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/property_map.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- property_map.h 14 Aug 2005 16:27:13 -0000 1.24
+++ property_map.h 5 Oct 2005 08:05:38 -0000 1.25
@@ -27,8 +27,8 @@
namespace KJS {
+ class IdentifierSequencedSet;
class ObjectImp;
- class ReferenceList;
class ValueImp;
class SavedProperty;
@@ -81,8 +81,8 @@
ValueImp **getLocation(const Identifier &name);
void mark() const;
- void addEnumerablesToReferenceList(ReferenceList &, ObjectImp *) const;
- void addSparseArrayPropertiesToReferenceList(ReferenceList &, ObjectImp *) const;
+ void getEnumerablePropertyNames(IdentifierSequencedSet&) const;
+ void getSparseArrayPropertyNames(IdentifierSequencedSet&) const;
void save(SavedProperties &) const;
void restore(const SavedProperties &p);
1.9 +0 -1 JavaScriptCore/kjs/protect.h
Index: protect.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/protect.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- protect.h 19 Sep 2005 06:57:27 -0000 1.8
+++ protect.h 5 Oct 2005 08:05:39 -0000 1.9
@@ -24,7 +24,6 @@
#ifndef _KJS_PROTECT_H_
#define _KJS_PROTECT_H_
-#include "reference.h"
#include "value.h"
#include "protected_values.h"
#include "interpreter.h"
1.43 +4 -0 JavaScriptCore/kjs/ustring.h
Index: ustring.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/ustring.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- ustring.h 3 Oct 2005 21:11:51 -0000 1.42
+++ ustring.h 5 Oct 2005 08:05:40 -0000 1.43
@@ -240,6 +240,8 @@
};
public:
+ typedef Rep Impl;
+
/**
* Constructs a null string.
*/
@@ -461,6 +463,8 @@
*/
static void globalClear();
#endif
+
+ Impl *impl() const { return rep; }
private:
UString(Rep *r) { attach(r); }
void attach(Rep *r) { rep = r; r->ref(); }
1.1 JavaScriptCore/kjs/IdentifierSequencedSet.cpp
Index: IdentifierSequencedSet.cpp
===================================================================
// -*- mode: c++; c-basic-offset: 4 -*-
/*
* This file is part of the KDE libraries
* Copyright (C) 2005 Apple Computer, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "IdentifierSequencedSet.h"
namespace KJS {
IdentifierSequencedSet::IdentifierSequencedSet()
: m_vector(0),
m_vectorLength(0),
m_vectorCapacity(0)
{
}
void IdentifierSequencedSet::deallocateVector()
{
for (int i = 0; i < m_vectorLength; ++i) {
(m_vector + i)->~Identifier();
}
fastFree(m_vector);
}
IdentifierSequencedSet::~IdentifierSequencedSet()
{
deallocateVector();
}
void IdentifierSequencedSet::insert(const Identifier& ident)
{
if (!m_set.insert(ident.ustring().impl()).second)
return;
if (m_vectorLength == m_vectorCapacity) {
m_vectorCapacity = m_vectorCapacity == 0 ? 16 : m_vectorCapacity * 11 / 10;
Identifier *newVector = reinterpret_cast<Identifier *>(fastMalloc(m_vectorCapacity * sizeof(Identifier)));
for (int i = 0; i < m_vectorLength; ++i) {
new (newVector + i) Identifier(m_vector[i]);
}
deallocateVector();
m_vector = newVector;
}
new (m_vector + m_vectorLength) Identifier(ident);
++m_vectorLength;
}
} // namespace KJS
1.1 JavaScriptCore/kjs/IdentifierSequencedSet.h
Index: IdentifierSequencedSet.h
===================================================================
// -*- mode: c++; c-basic-offset: 4 -*-
/*
* This file is part of the KDE libraries
* Copyright (C) 2005 Apple Computer, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef KJS_IDENTIFIER_SEQUENCED_SET_H
#define KJS_IDENTIFIER_SEQUENCED_SET_H
#include "identifier.h"
#include <kxmlcore/HashSet.h>
namespace KJS {
class IdentifierSequencedSet;
class IdentifierSequencedSetIterator {
private:
friend class IdentifierSequencedSet;
IdentifierSequencedSetIterator(const Identifier *position) : m_position(position) {}
public:
typedef IdentifierSequencedSetIterator iterator;
IdentifierSequencedSetIterator() {}
// default copy, assignment and destructor are ok
const Identifier& operator*() const
{
return *m_position;
}
const Identifier *operator->() const
{
return &(operator*());
}
iterator& operator++()
{
++m_position;
return *this;
}
// postfix ++ intentionally omitted
// Comparison.
bool operator==(const iterator& other) const
{
return m_position == other.m_position;
}
bool operator!=(const iterator& other) const
{
return m_position != other.m_position;
}
private:
const Identifier *m_position;
};
class IdentifierSequencedSet {
public:
typedef IdentifierSequencedSetIterator iterator;
IdentifierSequencedSet();
~IdentifierSequencedSet();
void insert(const Identifier&);
iterator begin() const { return iterator(m_vector); }
iterator end() const { return iterator(m_vector + m_vectorLength); }
int size() const { return m_vectorLength; }
private:
void deallocateVector();
typedef HashSet<UString::Impl *, PointerHash<UString::Impl *> > IdentifierSet;
IdentifierSet m_set;
Identifier *m_vector;
int m_vectorLength;
int m_vectorCapacity;
};
} // namespace KJS
#endif // KJS_IDENTIFIER_SEQUENCED_SET_H
1.2 +1 -1 JavaScriptCore/kxmlcore/HashSet.h
Index: HashSet.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kxmlcore/HashSet.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HashSet.h 28 Sep 2005 22:01:17 -0000 1.1
+++ HashSet.h 5 Oct 2005 08:05:43 -0000 1.2
@@ -25,7 +25,7 @@
#include "HashTable.h"
#include "HashTraits.h"
-#include "hashfunctions.h"
+#include "HashFunctions.h"
namespace KXMLCore {
1.10 +11 -0 LayoutTests/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/LayoutTests/ChangeLog,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ChangeLog 5 Oct 2005 07:11:36 -0000 1.9
+++ ChangeLog 5 Oct 2005 08:05:43 -0000 1.10
@@ -1,3 +1,14 @@
+2005-10-05 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Eric.
+
+ - test case for some fixes I made to for..in enumeration. object
+ properties now come before prototype properties and duplicates
+ between object and prototype are listed only once.
+
+ * fast/js/for-in-expected.txt: Added.
+ * fast/js/for-in.html: Added.
+
2005-10-05 Anders Carlsson <andersca at mac.com>
Reviewed by Maciej.
1.1 LayoutTests/fast/js/for-in-expected.txt
Index: for-in-expected.txt
===================================================================
This test checks whether for..in iteration properly skips duplicate entries, and whether it lists the properties of objects before those of their prototypes. It should print the following one per line in this order: "obj", "overloaded", "proto", "protoProto".
obj
overloaded
proto
protoProto
1.1 LayoutTests/fast/js/for-in.html
Index: for-in.html
===================================================================
<body>
<p>
This test checks whether for..in iteration properly skips duplicate
entries, and whether it lists the properties of objects before those
of their prototypes. It should print the following one per line in
this order: "obj", "overloaded", "proto", "protoProto".
<p>
<hr>
<pre id="console">
</pre>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function log(s)
{
document.getElementById('console').innerHTML += s + '<br>';
}
var protoProto = {protoProto: "protoProto", overloaded: "overloaded"};
var proto = {proto: "proto", overloaded: "overloaded"};
proto.__proto__ = protoProto;
var obj = {obj: "obj", overloaded: "overloaded"};
obj.__proto__ = proto;
for (var prop in obj) {
log(prop);
}
</script>
</body>
More information about the webkit-changes
mailing list