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

Side by Side Diff: test/cctest/test-api.cc

Issue 9402008: Uniformly handle 'undefined' store to Float64Array and Float32Array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/external-array.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 12884 matching lines...) Expand 10 before | Expand all | Expand 10 after
12895 kElementCount); 12895 kElementCount);
12896 result = CompileRun(test_buf.start()); 12896 result = CompileRun(test_buf.start());
12897 CHECK_EQ(false, result->BooleanValue()); 12897 CHECK_EQ(false, result->BooleanValue());
12898 12898
12899 // Check other boundary conditions, values and operations. 12899 // Check other boundary conditions, values and operations.
12900 result = CompileRun("for (var i = 0; i < 8; i++) {" 12900 result = CompileRun("for (var i = 0; i < 8; i++) {"
12901 " ext_array[7] = undefined;" 12901 " ext_array[7] = undefined;"
12902 "}" 12902 "}"
12903 "ext_array[7];"); 12903 "ext_array[7];");
12904 CHECK_EQ(0, result->Int32Value()); 12904 CHECK_EQ(0, result->Int32Value());
12905 CHECK_EQ( 12905 if (array_type == kExternalDoubleArray ||
12906 0, static_cast<int>(jsobj->GetElement(7)->ToObjectChecked()->Number())); 12906 array_type == kExternalFloatArray) {
12907 CHECK_EQ(
12908 static_cast<int>(0x80000000),
12909 static_cast<int>(jsobj->GetElement(7)->ToObjectChecked()->Number()));
12910 } else {
12911 CHECK_EQ(0, static_cast<int>(
12912 jsobj->GetElement(7)->ToObjectChecked()->Number()));
12913 }
12907 12914
12908 result = CompileRun("for (var i = 0; i < 8; i++) {" 12915 result = CompileRun("for (var i = 0; i < 8; i++) {"
12909 " ext_array[6] = '2.3';" 12916 " ext_array[6] = '2.3';"
12910 "}" 12917 "}"
12911 "ext_array[6];"); 12918 "ext_array[6];");
12912 CHECK_EQ(2, result->Int32Value()); 12919 CHECK_EQ(2, result->Int32Value());
12913 CHECK_EQ( 12920 CHECK_EQ(
12914 2, static_cast<int>(jsobj->GetElement(6)->ToObjectChecked()->Number())); 12921 2, static_cast<int>(jsobj->GetElement(6)->ToObjectChecked()->Number()));
12915 12922
12916 if (array_type != v8::kExternalFloatArray && 12923 if (array_type != v8::kExternalFloatArray &&
(...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after
16076 CompileRun("throw 'exception';"); 16083 CompileRun("throw 'exception';");
16077 } 16084 }
16078 16085
16079 16086
16080 TEST(CallCompletedCallbackTwoExceptions) { 16087 TEST(CallCompletedCallbackTwoExceptions) {
16081 v8::HandleScope scope; 16088 v8::HandleScope scope;
16082 LocalContext env; 16089 LocalContext env;
16083 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException); 16090 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException);
16084 CompileRun("throw 'first exception';"); 16091 CompileRun("throw 'first exception';");
16085 } 16092 }
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/external-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698