Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #75 from apiaryio/kylef/module
Browse files Browse the repository at this point in the history
Allow overriding `Module` and environment
  • Loading branch information
kylef authored Jan 24, 2017
2 parents fd267fa + ecec969 commit 261d366
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# drafter.js Changelog

## 2.6.4

### Bug Fixes

- Drafter.js will no longer override `Module` allowing drafter.js users to
[override the emscripten execution
environment](https://kripken.github.io/emscripten-site/docs/api_reference/module.html#overriding-execution-environment).


## 2.6.3

This update now uses Drafter 3.2.3. Please see [Drafter
Expand Down
2 changes: 1 addition & 1 deletion ext/drafter
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "drafter.js",
"version": "2.6.3",
"version": "2.6.4",
"description": "Pure JS Drafter built with Emscripten",
"main": "lib/drafter.nomem.js",
"scripts": {
Expand Down
16 changes: 10 additions & 6 deletions src/pre.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
var Module = {
'ready': false,
'log': function(text) { console.log('drafter.js: ' + text); },
'logErr': function(text) { console.error('drafter.js: ' + text); },
'onRuntimeInitialized': function() { this.ready = true; }
};
var Module;

if (!Module) {
Module = {};
}

Module['ready'] = false;
Module['log'] = function(text) { console.log('drafter.js: ' + text); };
Module['logErr'] = function(text) { console.error('drafter.js: ' + text); };
Module['onRuntimeInitialized'] = function() { this.ready = true; };

0 comments on commit 261d366

Please sign in to comment.