OLD | NEW |
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 assertEquals(-2, R.v) | 105 assertEquals(-2, R.v) |
106 | 106 |
107 assertThrows(function() { l = -1 }, ReferenceError) | 107 assertThrows(function() { l = -1 }, ReferenceError) |
108 assertThrows(function() { R.l = -2 }, ReferenceError) | 108 assertThrows(function() { R.l = -2 }, ReferenceError) |
109 assertThrows(function() { l }, ReferenceError) | 109 assertThrows(function() { l }, ReferenceError) |
110 assertThrows(function() { R.l }, ReferenceError) | 110 assertThrows(function() { R.l }, ReferenceError) |
111 | 111 |
112 assertThrows(function() { eval("c = -1") }, SyntaxError) | 112 assertThrows(function() { eval("c = -1") }, SyntaxError) |
113 assertThrows(function() { R.c = -2 }, TypeError) | 113 assertThrows(function() { R.c = -2 }, TypeError) |
114 | 114 |
115 // Initialize first bunch or variables. | 115 // Initialize first bunch of variables. |
116 export var v = 1 | 116 export var v = 1 |
117 export let l = 2 | 117 export let l = 2 |
118 export const c = 3 | 118 export const c = 3 |
119 export function f() { return 4 } | 119 export function f() { return 4 } |
120 | 120 |
121 assertEquals(1, v) | 121 assertEquals(1, v) |
122 assertEquals(1, R.v) | 122 assertEquals(1, R.v) |
123 assertEquals(2, l) | 123 assertEquals(2, l) |
124 assertEquals(2, R.l) | 124 assertEquals(2, R.l) |
125 assertEquals(3, c) | 125 assertEquals(3, c) |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 assertSame(B, A.C.D); | 289 assertSame(B, A.C.D); |
290 assertSame(A.C, A.C.C); | 290 assertSame(A.C, A.C.C); |
291 assertFalse(A.D === A.C.D); | 291 assertFalse(A.D === A.C.D); |
292 | 292 |
293 assertSame(M1, M2.A1); | 293 assertSame(M1, M2.A1); |
294 assertSame(M2, M1.A2); | 294 assertSame(M2, M1.A2); |
295 assertSame(M1, M1.A2.A1); | 295 assertSame(M1, M1.A2.A1); |
296 assertSame(M2, M2.A1.A2); | 296 assertSame(M2, M2.A1.A2); |
297 | 297 |
298 assertEquals("1234567890", log); | 298 assertEquals("1234567890", log); |
OLD | NEW |