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

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

Issue 10816002: Merged r12088 into 3.8 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.8
Patch Set: Created 8 years, 5 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/version.cc ('k') | no next file » | 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 15930 matching lines...) Expand 10 before | Expand all | Expand 10 after
15941 CompileRun("throw 'exception';"); 15941 CompileRun("throw 'exception';");
15942 } 15942 }
15943 15943
15944 15944
15945 TEST(CallCompletedCallbackTwoExceptions) { 15945 TEST(CallCompletedCallbackTwoExceptions) {
15946 v8::HandleScope scope; 15946 v8::HandleScope scope;
15947 LocalContext env; 15947 LocalContext env;
15948 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException); 15948 v8::V8::AddCallCompletedCallback(CallCompletedCallbackException);
15949 CompileRun("throw 'first exception';"); 15949 CompileRun("throw 'first exception';");
15950 } 15950 }
15951
15952
15953 THREADED_TEST(Regress137002a) {
15954 i::FLAG_allow_natives_syntax = true;
15955 v8::HandleScope scope;
15956 LocalContext context;
15957 Local<ObjectTemplate> templ = ObjectTemplate::New();
15958 templ->SetAccessor(v8_str("foo"),
15959 GetterWhichReturns42,
15960 SetterWhichSetsYOnThisTo23);
15961 context->Global()->Set(v8_str("obj"), templ->NewInstance());
15962
15963 // Turn monomorphic on slow object with native accessor, then turn
15964 // polymorphic, finally optimize to create negative lookup and fail.
15965 CompileRun("function f(x) { return x.foo; }"
15966 "%OptimizeObjectForAddingMultipleProperties(obj, 1);"
15967 "obj.__proto__ = null;"
15968 "f(obj); f(obj); f({});"
15969 "%OptimizeFunctionOnNextCall(f);"
15970 "var result = f(obj);");
15971 CHECK_EQ(42, context->Global()->Get(v8_str("result"))->Int32Value());
15972 }
15973
15974
15975 THREADED_TEST(Regress137002b) {
15976 i::FLAG_allow_natives_syntax = true;
15977 v8::HandleScope scope;
15978 LocalContext context;
15979 Local<ObjectTemplate> templ = ObjectTemplate::New();
15980 templ->SetAccessor(v8_str("foo"),
15981 GetterWhichReturns42,
15982 SetterWhichSetsYOnThisTo23);
15983 context->Global()->Set(v8_str("obj"), templ->NewInstance());
15984
15985 // Turn monomorphic on slow object with native accessor, then just
15986 // delete the property and fail.
15987 CompileRun("function f(x) { return x.foo; }"
15988 "%OptimizeObjectForAddingMultipleProperties(obj, 1);"
15989 "obj.__proto__ = null;"
15990 "f(obj); f(obj); delete obj.foo;"
15991 "var result = f(obj);");
15992 CHECK(context->Global()->Get(v8_str("result"))->IsUndefined());
15993 }
OLDNEW
« 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