Skip to content

@JSName(variable) annotation does not fail on objects and classes #1664

@helllamer

Description

@helllamer
object Constants {
  def CONST_1 = "bar"
}


import Constants._

@JSName(CONST_1)
object foo extends js.Object {
 ...
}

When i'm calling fastOptJS and fullOptJS, no error occurs, but it should.
When i'm running this code in browser, foo is undefined runtime exception occurs.
scala.js 0.6.3.

Normally, some like this must be thrown during compile:

[error] TestCase.scala:8: The argument to JSName must be a literal string
[error]   @JSName(CONST_1)
[error]    ^
[error] one error found

Metadata

Metadata

Assignees

Labels

bugConfirmed bug. Needs to be fixed.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions