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

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

Issue 7562005: Revert "Make window.{undefined,NaN,Infinity} read-only" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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/v8natives.js ('k') | test/es5conform/es5conform.status » ('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 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 491
492 492
493 TEST(Reappearing) { 493 TEST(Reappearing) {
494 HandleScope scope; 494 HandleScope scope;
495 495
496 { ReappearingPropertyContext context; 496 { ReappearingPropertyContext context;
497 context.Check("const x; var x = 0", 497 context.Check("const x; var x = 0",
498 0, 498 0,
499 2, // var declaration + const initialization 499 2, // var declaration + const initialization
500 4, // 2 x declaration + 2 x initialization 500 4, // 2 x declaration + 2 x initialization
501 EXPECT_RESULT, Undefined()); // x = 0 fails for a const. 501 EXPECT_EXCEPTION); // x has already been declared!
502 } 502 }
503 } 503 }
504 504
505 505
506 506
507 class ExistsInPrototypeContext: public DeclarationContext { 507 class ExistsInPrototypeContext: public DeclarationContext {
508 protected: 508 protected:
509 virtual v8::Handle<Integer> Query(Local<String> key) { 509 virtual v8::Handle<Integer> Query(Local<String> key) {
510 // Let it seem that the property exists in the prototype object. 510 // Let it seem that the property exists in the prototype object.
511 return Integer::New(v8::None); 511 return Integer::New(v8::None);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 HandleScope scope; 584 HandleScope scope;
585 585
586 { AbsentInPrototypeContext context; 586 { AbsentInPrototypeContext context;
587 context.Check("if (false) { var x = 0; }; x", 587 context.Check("if (false) { var x = 0; }; x",
588 0, 588 0,
589 0, 589 0,
590 1, // declaration 590 1, // declaration
591 EXPECT_RESULT, Undefined()); 591 EXPECT_RESULT, Undefined());
592 } 592 }
593 } 593 }
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | test/es5conform/es5conform.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698