Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Identifier already declared issue in JS tab #12

Description

@mmarquardt610

We use the inline code suite in the learning platform for Bloc, and we're running into an issue trying to teach objects and classes in javascript. When defining a class, we get an error that the identifier has already been declared.

Here's a reproducible example in jsfiddle:
https://jsfiddle.net/j5L0t69c/
Once loaded, click Run in jsfiddle, then put the following in the JS tab:

class Person {
 constructor(name, age, hometown) {
   this.name = name;
   this.age = age;
   this.hometown = hometown;
   this.type = 'Student';
 }
 getName() {
   return this.name;
 }
}

After clicking Run in the inline code suite, the following error surfaces:

SyntaxError: Identifier 'Person' has already been declared

I also tried enabled/disabled the autoRun and useLocalStorage flags, and I get the same results in every experiment with different values.

screen shot 2018-05-17 at 2 12 47 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions