Skip to content

Conversation

@Fatme
Copy link
Contributor

@Fatme Fatme commented Jan 29, 2019

As the runtimes set the require as a readonly property to global object, it is not possible to assign to it when "strict" mode is used.
The following code throws an error in runtime TypeError: Attempted to assign to readonly property.

global.require = function () {
      throw Error();
}

Currently when tsc is used, the produced code is in strict mode and it does not work in runtime.
Currently when grunt is used, the produced code is not in strict mode.

The new behavior unifies the tsc and grunt commands and compiles the code in non strict mode.

@Fatme Fatme merged commit 275ce35 into master Jan 29, 2019
@Fatme Fatme deleted the fatme/fix-assing-to-readonly branch January 29, 2019 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants