Skip to content

proxyquire "magic" invalidates strict-mode #64

@smcatala

Description

@smcatala
  • proxyquire-plugin injects an IIFE at the start of scripts that require("proxyquire").
  • the injected IIFE is inserted before any "use strict" statement in the script,
    invalidating strict-mode.
  • to work around this behaviour, the script can for example be encapsulated
    in a strict-mode function, e.g. an IIFE or a describe block.

please check this repository for a demonstration of this issue, based on the differing interpretation of "this" in an unbound function.

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