Skip to content

Commit

Permalink
Add an additional test for static method disambiguation on ES5 classes.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=248616183
  • Loading branch information
nreid260 authored and lauraharker committed May 17, 2019
1 parent 8abcdf6 commit da60eda
Showing 1 changed file with 26 additions and 1 deletion.
Expand Up @@ -2987,7 +2987,32 @@ public void testQuotedEs6ClassSetters_areNotDisambiguated() {
}

@Test
public void testDisambiguateEs6ClassStaticMethods() {
public void testDisambiguateEs5StaticMethods_declaredOutsideBody() {
test(
lines(
"/** @constructor */",
"function Foo() {}",
"Foo.method = function() { };",
"",
"class Bar {}",
"Bar.method = function() { };",
"",
"Foo.method();",
"Bar.method();"),
lines(
"/** @constructor */",
"function Foo() {}",
"Foo._typeof_Foo_$method = function() {}",
"",
"class Bar {}",
"Bar._typeof_Bar_$method = function() {}",
"",
"Foo._typeof_Foo_$method();",
"Bar._typeof_Bar_$method();"));
}

@Test
public void testDisambiguateEs6ClassStaticMethods_declaredInsideBody() {
test(
lines(
"class Foo {",
Expand Down

0 comments on commit da60eda

Please sign in to comment.