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

Side by Side Diff: third_party/closure_compiler/runner/test/com/google/javascript/jscomp/ChromePassTest.java

Issue 473853003: Fix in compiler pass: cr.defineProperty() with 2 arguments means opt_kind == cr.PropertyKind.JS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@D_define_once_rebase
Patch Set: Created 6 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
« no previous file with comments | « third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package com.google.javascript.jscomp; 5 package com.google.javascript.jscomp;
6 6
7 /** 7 /**
8 * Tests {@link ChromePass}. 8 * Tests {@link ChromePass}.
9 */ 9 */
10 public class ChromePassTest extends CompilerTestCase { 10 public class ChromePassTest extends CompilerTestCase {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 public void testCrDefinePropertyDefinesUnquotedPropertyWithAnyTypeForPropert yKindJs() 213 public void testCrDefinePropertyDefinesUnquotedPropertyWithAnyTypeForPropert yKindJs()
214 throws Exception { 214 throws Exception {
215 test( 215 test(
216 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);", 216 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);",
217 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);\n" + 217 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);\n" +
218 "/** @type {?} */\n" + 218 "/** @type {?} */\n" +
219 "a.prototype.c;"); 219 "a.prototype.c;");
220 } 220 }
221 221
222 public void testCrDefinePropertyCalledWithouthThirdArgumentMeansCrPropertyKi ndJs()
223 throws Exception {
224 test(
225 "cr.defineProperty(a.prototype, 'c');",
226 "cr.defineProperty(a.prototype, 'c');\n" +
227 "/** @type {?} */\n" +
228 "a.prototype.c;");
229 }
230
222 public void testCrDefinePropertyDefinesUnquotedPropertyOnPrototypeWhenFuncti onIsPassed() 231 public void testCrDefinePropertyDefinesUnquotedPropertyOnPrototypeWhenFuncti onIsPassed()
223 throws Exception { 232 throws Exception {
224 test( 233 test(
225 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);", 234 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);",
226 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);\n" + 235 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);\n" +
227 "/** @type {?} */\n" + 236 "/** @type {?} */\n" +
228 "a.prototype.c;"); 237 "a.prototype.c;");
229 } 238 }
230 239
231 public void testCrDefinePropertyInvalidPropertyKind() 240 public void testCrDefinePropertyInvalidPropertyKind()
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 "cr.define('cr.ui', function() {\n" + 302 "cr.define('cr.ui', function() {\n" +
294 " return {};\n" + 303 " return {};\n" +
295 "});"); 304 "});");
296 } 305 }
297 306
298 public void testCrExportPathInvalidNumberOfArguments() throws Exception { 307 public void testCrExportPathInvalidNumberOfArguments() throws Exception {
299 test("cr.exportPath();", null, ChromePass.CR_EXPORT_PATH_WRONG_NUMBER_OF _ARGUMENTS); 308 test("cr.exportPath();", null, ChromePass.CR_EXPORT_PATH_WRONG_NUMBER_OF _ARGUMENTS);
300 } 309 }
301 310
302 } 311 }
OLDNEW
« no previous file with comments | « third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698