Skip to content

Commit 0dcc7c3

Browse files
committed
Merge pull request reduxjs#701 from timdorr/cortexiphan
Switch out contextify for vm
2 parents 1a07da3 + a59d0b0 commit 0dcc7c3

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

examples/todomvc/components/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Header extends Component {
1212
return (
1313
<header className="header">
1414
<h1>todos</h1>
15-
<TodoTextInput newTodo={true}
15+
<TodoTextInput newTodo
1616
onSave={this.handleSave.bind(this)}
1717
placeholder="What needs to be done?" />
1818
</header>

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"babel-core": "^5.6.18",
5656
"babel-eslint": "^4.1.0",
5757
"babel-loader": "^5.1.4",
58-
"contextify": "^0.1.14",
5958
"eslint": "^1.2.1",
6059
"eslint-config-airbnb": "0.0.8",
6160
"eslint-plugin-react": "^3.2.3",

test/utils/isPlainObject.spec.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import expect from 'expect';
22
import isPlainObject from '../../src/utils/isPlainObject';
3-
import contextify from 'contextify';
3+
import vm from 'vm';
44

55
describe('isPlainObject', () => {
66
it('should return true only if plain object', () => {
77
function Test() {
88
this.prop = 1;
99
}
1010

11-
const sandbox = contextify();
12-
sandbox.run('var fromAnotherRealm = {};');
11+
const sandbox = { fromAnotherRealm: false };
12+
vm.runInNewContext('fromAnotherRealm = {}', sandbox);
1313

1414
expect(isPlainObject(sandbox.fromAnotherRealm)).toBe(true);
1515
expect(isPlainObject(new Test())).toBe(false);
@@ -18,7 +18,5 @@ describe('isPlainObject', () => {
1818
expect(isPlainObject(null)).toBe(false);
1919
expect(isPlainObject()).toBe(false);
2020
expect(isPlainObject({ 'x': 1, 'y': 2 })).toBe(true);
21-
22-
sandbox.dispose();
2321
});
2422
});

0 commit comments

Comments
 (0)