Author: [EMAIL PROTECTED]
Date: Tue Oct 7 02:04:23 2008
New Revision: 454
Modified:
branches/bleeding_edge/src/objects-inl.h
branches/bleeding_edge/test/mjsunit/switch.js
Log:
Fixed typo
Modified: branches/bleeding_edge/src/objects-inl.h
==============================================================================
--- branches/bleeding_edge/src/objects-inl.h (original)
+++ branches/bleeding_edge/src/objects-inl.h Tue Oct 7 02:04:23 2008
@@ -1321,17 +1321,17 @@
bool String::IsFlat() {
- String* current = this;
- while (true) {
- switch (current->representation_tag()) {
- case kConsStringTag:
- return String::cast(ConsString::cast(current)->second())->length()
== 0;
- case kSlicedStringTag:
- current = String::cast(SlicedString::cast(this)->buffer());
- break;
- default:
- return true;
+ switch (this->representation_tag()) {
+ case kConsStringTag:
+ // Only flattened strings have second part empty.
+ return String::cast(ConsString::cast(this)->second())->length() == 0;
+ case kSlicedStringTag: {
+ String* slice = String::cast(SlicedString::cast(this)->buffer());
+ StringRepresentationTag tag = slice->representation_tag();
+ return tag == kSeqStringTag || tag == kExternalStringTag;
}
+ default:
+ return true;
}
}
Modified: branches/bleeding_edge/test/mjsunit/switch.js
==============================================================================
--- branches/bleeding_edge/test/mjsunit/switch.js (original)
+++ branches/bleeding_edge/test/mjsunit/switch.js Tue Oct 7 02:04:23 2008
@@ -27,7 +27,7 @@
function f0() {
switch (0) {
- // switch deliberatly left empty
+ // switch deliberately left empty
}
}
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---