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

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

Issue 638193004: Keyed loads from super with numeric keys. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor test update Created 6 years, 2 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/runtime-classes.cc ('k') | test/mjsunit/harmony/super.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 9688 matching lines...) Expand 10 before | Expand all | Expand 10 after
9699 CompileRun( 9699 CompileRun(
9700 "function f() { return super.hasOwnProperty; };" 9700 "function f() { return super.hasOwnProperty; };"
9701 "var m = f.toMethod(prohibited);" 9701 "var m = f.toMethod(prohibited);"
9702 "m();"); 9702 "m();");
9703 CHECK(try_catch.HasCaught()); 9703 CHECK(try_catch.HasCaught());
9704 } 9704 }
9705 9705
9706 { 9706 {
9707 v8::TryCatch try_catch; 9707 v8::TryCatch try_catch;
9708 CompileRun( 9708 CompileRun(
9709 "function f() { return super[42]; };"
9710 "var m = f.toMethod(prohibited);"
9711 "m();");
9712 CHECK(try_catch.HasCaught());
9713 }
9714
9715 {
9716 v8::TryCatch try_catch;
9717 CompileRun(
9709 "function f() { super.hasOwnProperty = function () {}; };" 9718 "function f() { super.hasOwnProperty = function () {}; };"
9710 "var m = f.toMethod(prohibited);" 9719 "var m = f.toMethod(prohibited);"
9711 "m();"); 9720 "m();");
9712 CHECK(try_catch.HasCaught()); 9721 CHECK(try_catch.HasCaught());
9713 } 9722 }
9714 9723
9715 { 9724 {
9716 v8::TryCatch try_catch; 9725 v8::TryCatch try_catch;
9717 CompileRun( 9726 CompileRun(
9718 "Object.defineProperty(Object.prototype, 'x', { set : function(){}});" 9727 "Object.defineProperty(Object.prototype, 'x', { set : function(){}});"
(...skipping 14078 matching lines...) Expand 10 before | Expand all | Expand 10 after
23797 " var foobXXXXX"; // Too many bytes which look like incomplete chars! 23806 " var foobXXXXX"; // Too many bytes which look like incomplete chars!
23798 char chunk2[] = 23807 char chunk2[] =
23799 "r = 13;\n" 23808 "r = 13;\n"
23800 " return foob\xeb\x91\x80\x80\x80r;\n" 23809 " return foob\xeb\x91\x80\x80\x80r;\n"
23801 "}\n"; 23810 "}\n";
23802 for (int i = 0; i < 5; ++i) chunk1[strlen(chunk1) - 5 + i] = reference[i]; 23811 for (int i = 0; i < 5; ++i) chunk1[strlen(chunk1) - 5 + i] = reference[i];
23803 23812
23804 const char* chunks[] = {chunk1, chunk2, "foo();", NULL}; 23813 const char* chunks[] = {chunk1, chunk2, "foo();", NULL};
23805 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8, false); 23814 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8, false);
23806 } 23815 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/super.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698