Skip to content

Commit

Permalink
Add more tests around namespace in jsinterop_generator.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 669404224
  • Loading branch information
mollyibot authored and copybara-github committed Aug 30, 2024
1 parent 36b4c5c commit 8eae1ff
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package jsinterop.generator.externs.modules.namespace;

import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

@JsType(isNative = true, name = "namespace.NamespacedClass", namespace = JsPackage.GLOBAL)
public class NamespacedClass {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package jsinterop.generator.externs.modules.namespace;

import jsinterop.annotations.JsEnum;
import jsinterop.annotations.JsPackage;

@JsEnum(isNative = true, name = "namespace.NamespacedEnum", namespace = JsPackage.GLOBAL)
public enum NamespacedEnum {
A,
B;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package jsinterop.generator.externs.modules.namespace;

import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

@JsType(isNative = true, name = "namespace.NamespacedRecord", namespace = JsPackage.GLOBAL)
public interface NamespacedRecord {}
15 changes: 15 additions & 0 deletions javatests/jsinterop/generator/externs/modules/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ namespace.staticProperty;
*/
namespace.NamespacedInterface = function() {};

/**
* @record
*/
namespace.NamespacedRecord = function() {};

/**
* @constructor
*/
namespace.NamespacedClass = function() {};

/**
* @enum {string}
*/
namespace.NamespacedEnum = {A: 'A', B: 'B'};

/**
* @const
*/
Expand Down

0 comments on commit 8eae1ff

Please sign in to comment.