ClojureScript

NON_TOP_LEVEL_STATEMENT_DEFINE error when trying to process a CommonJS module

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: GSoC
  • Fix Version/s: GSoC
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

The process for converting CommonJS and AMD modules is the same except for one step. We forgot to add a module type check for this one step, meaning that AMD and CommonJS are currently processed exactly the same, which results in the following error:

ERROR: NON_TOP_LEVEL_STATEMENT_DEFINE. The define function must be called as a top-level statement. at libs/d3.js line 9501 : 50

Activity

Hide
Maria Geller added a comment -

Uploaded patch. Fixed this by checking module type before attempting to convert from AMD to CommonJS.

Show
Maria Geller added a comment - Uploaded patch. Fixed this by checking module type before attempting to convert from AMD to CommonJS.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: