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

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

Issue 227573002: Return MaybeHandle from SetElement and DeleteElement. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-parsing.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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 Handle<Smi> two(Smi::FromInt(2), isolate); 676 Handle<Smi> two(Smi::FromInt(2), isolate);
677 677
678 // check for empty 678 // check for empty
679 CHECK(!JSReceiver::HasLocalProperty(obj, first)); 679 CHECK(!JSReceiver::HasLocalProperty(obj, first));
680 680
681 // add first 681 // add first
682 JSReceiver::SetProperty(obj, first, one, NONE, SLOPPY).Check(); 682 JSReceiver::SetProperty(obj, first, one, NONE, SLOPPY).Check();
683 CHECK(JSReceiver::HasLocalProperty(obj, first)); 683 CHECK(JSReceiver::HasLocalProperty(obj, first));
684 684
685 // delete first 685 // delete first
686 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION); 686 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION).Check();
687 CHECK(!JSReceiver::HasLocalProperty(obj, first)); 687 CHECK(!JSReceiver::HasLocalProperty(obj, first));
688 688
689 // add first and then second 689 // add first and then second
690 JSReceiver::SetProperty(obj, first, one, NONE, SLOPPY).Check(); 690 JSReceiver::SetProperty(obj, first, one, NONE, SLOPPY).Check();
691 JSReceiver::SetProperty(obj, second, two, NONE, SLOPPY).Check(); 691 JSReceiver::SetProperty(obj, second, two, NONE, SLOPPY).Check();
692 CHECK(JSReceiver::HasLocalProperty(obj, first)); 692 CHECK(JSReceiver::HasLocalProperty(obj, first));
693 CHECK(JSReceiver::HasLocalProperty(obj, second)); 693 CHECK(JSReceiver::HasLocalProperty(obj, second));
694 694
695 // delete first and then second 695 // delete first and then second
696 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION); 696 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION).Check();
697 CHECK(JSReceiver::HasLocalProperty(obj, second)); 697 CHECK(JSReceiver::HasLocalProperty(obj, second));
698 JSReceiver::DeleteProperty(obj, second, JSReceiver::NORMAL_DELETION); 698 JSReceiver::DeleteProperty(obj, second, JSReceiver::NORMAL_DELETION).Check();
699 CHECK(!JSReceiver::HasLocalProperty(obj, first)); 699 CHECK(!JSReceiver::HasLocalProperty(obj, first));
700 CHECK(!JSReceiver::HasLocalProperty(obj, second)); 700 CHECK(!JSReceiver::HasLocalProperty(obj, second));
701 701
702 // add first and then second 702 // add first and then second
703 JSReceiver::SetProperty(obj, first, one, NONE, SLOPPY).Check(); 703 JSReceiver::SetProperty(obj, first, one, NONE, SLOPPY).Check();
704 JSReceiver::SetProperty(obj, second, two, NONE, SLOPPY).Check(); 704 JSReceiver::SetProperty(obj, second, two, NONE, SLOPPY).Check();
705 CHECK(JSReceiver::HasLocalProperty(obj, first)); 705 CHECK(JSReceiver::HasLocalProperty(obj, first));
706 CHECK(JSReceiver::HasLocalProperty(obj, second)); 706 CHECK(JSReceiver::HasLocalProperty(obj, second));
707 707
708 // delete second and then first 708 // delete second and then first
709 JSReceiver::DeleteProperty(obj, second, JSReceiver::NORMAL_DELETION); 709 JSReceiver::DeleteProperty(obj, second, JSReceiver::NORMAL_DELETION).Check();
710 CHECK(JSReceiver::HasLocalProperty(obj, first)); 710 CHECK(JSReceiver::HasLocalProperty(obj, first));
711 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION); 711 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION).Check();
712 CHECK(!JSReceiver::HasLocalProperty(obj, first)); 712 CHECK(!JSReceiver::HasLocalProperty(obj, first));
713 CHECK(!JSReceiver::HasLocalProperty(obj, second)); 713 CHECK(!JSReceiver::HasLocalProperty(obj, second));
714 714
715 // check string and internalized string match 715 // check string and internalized string match
716 const char* string1 = "fisk"; 716 const char* string1 = "fisk";
717 Handle<String> s1 = factory->NewStringFromAscii(CStrVector(string1)); 717 Handle<String> s1 = factory->NewStringFromAscii(CStrVector(string1));
718 JSReceiver::SetProperty(obj, s1, one, NONE, SLOPPY).Check(); 718 JSReceiver::SetProperty(obj, s1, one, NONE, SLOPPY).Check();
719 Handle<String> s1_string = factory->InternalizeUtf8String(string1); 719 Handle<String> s1_string = factory->InternalizeUtf8String(string1);
720 CHECK(JSReceiver::HasLocalProperty(obj, s1_string)); 720 CHECK(JSReceiver::HasLocalProperty(obj, s1_string));
721 721
(...skipping 3215 matching lines...) Expand 10 before | Expand all | Expand 10 after
3937 v8::Context::Scope cscope(context); 3937 v8::Context::Scope cscope(context);
3938 3938
3939 v8::Local<v8::Value> result = CompileRun( 3939 v8::Local<v8::Value> result = CompileRun(
3940 "var locals = '';" 3940 "var locals = '';"
3941 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';" 3941 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';"
3942 "eval('function f() {' + locals + 'return function() { return v0; }; }');" 3942 "eval('function f() {' + locals + 'return function() { return v0; }; }');"
3943 "interrupt();" // This triggers a fake stack overflow in f. 3943 "interrupt();" // This triggers a fake stack overflow in f.
3944 "f()()"); 3944 "f()()");
3945 CHECK_EQ(42.0, result->ToNumber()->Value()); 3945 CHECK_EQ(42.0, result->ToNumber()->Value());
3946 } 3946 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698