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

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

Issue 9443014: Fix redefinition of aliased elements in arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Sven Panne. 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/runtime.cc ('k') | test/cctest/test-heap.cc » ('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 12313 matching lines...) Expand 10 before | Expand all | Expand 10 after
12324 12324
12325 result = CompileRun("var sum = 0;" 12325 result = CompileRun("var sum = 0;"
12326 "for (var i = 0; i < 8; i++) {" 12326 "for (var i = 0; i < 8; i++) {"
12327 " sum += pixels[i];" 12327 " sum += pixels[i];"
12328 "}" 12328 "}"
12329 "sum;"); 12329 "sum;");
12330 CHECK_EQ(28, result->Int32Value()); 12330 CHECK_EQ(28, result->Int32Value());
12331 12331
12332 i::Handle<i::Smi> value(i::Smi::FromInt(2)); 12332 i::Handle<i::Smi> value(i::Smi::FromInt(2));
12333 i::Handle<i::Object> no_failure; 12333 i::Handle<i::Object> no_failure;
12334 no_failure = i::JSObject::SetElement(jsobj, 1, value, i::kNonStrictMode); 12334 no_failure =
12335 i::JSObject::SetElement(jsobj, 1, value, NONE, i::kNonStrictMode);
12335 ASSERT(!no_failure.is_null()); 12336 ASSERT(!no_failure.is_null());
12336 i::USE(no_failure); 12337 i::USE(no_failure);
12337 CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); 12338 CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
12338 *value.location() = i::Smi::FromInt(256); 12339 *value.location() = i::Smi::FromInt(256);
12339 no_failure = i::JSObject::SetElement(jsobj, 1, value, i::kNonStrictMode); 12340 no_failure =
12341 i::JSObject::SetElement(jsobj, 1, value, NONE, i::kNonStrictMode);
12340 ASSERT(!no_failure.is_null()); 12342 ASSERT(!no_failure.is_null());
12341 i::USE(no_failure); 12343 i::USE(no_failure);
12342 CHECK_EQ(255, 12344 CHECK_EQ(255,
12343 i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); 12345 i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
12344 *value.location() = i::Smi::FromInt(-1); 12346 *value.location() = i::Smi::FromInt(-1);
12345 no_failure = i::JSObject::SetElement(jsobj, 1, value, i::kNonStrictMode); 12347 no_failure =
12348 i::JSObject::SetElement(jsobj, 1, value, NONE, i::kNonStrictMode);
12346 ASSERT(!no_failure.is_null()); 12349 ASSERT(!no_failure.is_null());
12347 i::USE(no_failure); 12350 i::USE(no_failure);
12348 CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); 12351 CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
12349 12352
12350 result = CompileRun("for (var i = 0; i < 8; i++) {" 12353 result = CompileRun("for (var i = 0; i < 8; i++) {"
12351 " pixels[i] = (i * 65) - 109;" 12354 " pixels[i] = (i * 65) - 109;"
12352 "}" 12355 "}"
12353 "pixels[1] + pixels[6];"); 12356 "pixels[1] + pixels[6];");
12354 CHECK_EQ(255, result->Int32Value()); 12357 CHECK_EQ(255, result->Int32Value());
12355 CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0)->ToObjectChecked())->value()); 12358 CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0)->ToObjectChecked())->value());
(...skipping 3736 matching lines...) Expand 10 before | Expand all | Expand 10 after
16092 CompileRun("throw 'exception';"); 16095 CompileRun("throw 'exception';");
16093 } 16096 }
16094 16097
16095 16098
16096 TEST(CallCompletedCallbackTwoExceptions) { 16099 TEST(CallCompletedCallbackTwoExceptions) {
16097 v8::HandleScope scope; 16100 v8::HandleScope scope;
16098 LocalContext env; 16101 LocalContext env;
16099 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException); 16102 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException);
16100 CompileRun("throw 'first exception';"); 16103 CompileRun("throw 'first exception';");
16101 } 16104 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698