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

Side by Side Diff: test/mjsunit/const-redecl.js

Issue 8888006: Make more JS files beter match the coding standard. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 9 years 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/mjsunit/compiler/thisfunction.js ('k') | test/mjsunit/constant-folding.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 const h; var h = 1; 262 const h; var h = 1;
263 assertEquals(undefined,h, "h has wrong value"); 263 assertEquals(undefined,h, "h has wrong value");
264 264
265 eval("Object.defineProperty(this, 'i', { writable: true });" 265 eval("Object.defineProperty(this, 'i', { writable: true });"
266 + "const i = 7;" 266 + "const i = 7;"
267 + "assertEquals(7, i, \"i has wrong value\");"); 267 + "assertEquals(7, i, \"i has wrong value\");");
268 268
269 var global = this; 269 var global = this;
270 assertThrows(function() { 270 assertThrows(function() {
271 Object.defineProperty(global, 'j', { writable: true }) 271 Object.defineProperty(global, 'j', { writable: true });
272 }, TypeError); 272 }, TypeError);
273 const j = 2; // This is what makes the function above throw, because the 273 const j = 2; // This is what makes the function above throw, because the
274 // const declaration gets hoisted and makes the property non-configurable. 274 // const declaration gets hoisted and makes the property non-configurable.
275 assertEquals(2, j, "j has wrong value"); 275 assertEquals(2, j, "j has wrong value");
276 276
277 var k = 1; const k; 277 var k = 1; const k;
278 // You could argue about the expected result here. For now, the winning 278 // You could argue about the expected result here. For now, the winning
279 // argument is that "const k;" is equivalent to "const k = undefined;". 279 // argument is that "const k;" is equivalent to "const k = undefined;".
280 assertEquals(undefined, k, "k has wrong value"); 280 assertEquals(undefined, k, "k has wrong value");
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/thisfunction.js ('k') | test/mjsunit/constant-folding.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698