Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: test/mjsunit/regress/regress-crbug-229923.js

Issue 14170004: Merged r14224 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-229923.js
diff --git a/test/cctest/test-platform.cc b/test/mjsunit/regress/regress-crbug-229923.js
similarity index 73%
copy from test/cctest/test-platform.cc
copy to test/mjsunit/regress/regress-crbug-229923.js
index 6c20b853c5e7408b1877ee74617c01c3fc32ed5f..95c0dedefd6f3ef945aeb30226f5c74c91c3f135 100644
--- a/test/cctest/test-platform.cc
+++ b/test/mjsunit/regress/regress-crbug-229923.js
@@ -25,13 +25,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <stdlib.h>
+// Flags: --expose-externalize-string
-#include "cctest.h"
-#include "platform.h"
+var slice = "slow path of JSON.stringify for sliced string".substring(1);
+assertEquals('"' + slice + '"', JSON.stringify(slice, null, 0));
-using namespace ::v8::internal;
-
-TEST(NumberOfCores) {
- CHECK_GT(OS::NumberOfCores(), 0);
-}
+var parent = "external string turned into two byte";
+var slice_of_external = parent.substring(1);
+try {
+ // Turn the string to a two-byte external string, so that the sliced
+ // string looks like one-byte, but its parent is actually two-byte.
+ externalizeString(parent, true);
+} catch (e) { }
+assertEquals('"' + slice_of_external + '"',
+ JSON.stringify(slice_of_external, null, 0));
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698