Skip to content

Commit

Permalink
Fixed accidental dependency on the node typings. Fixes #1387, #1362
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Mar 12, 2018
1 parent 8cf6813 commit 3baf30c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dist/
*.iml
*.ipr
*.iws
yarn-error.log
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

# 3.6.2

* Fixed accidental dependency on the `node` typings. Fixes [#1387](https://github.com/mobxjs/mobx/issues/1387) / [#1362](https://github.com/mobxjs/mobx/issues/1387)

# 3.6.1

* Fixed [#1358](https://github.com/mobxjs/mobx/pull/1359): Deep comparison failing on IE11. By [le0nik](https://github.com/le0nik) through [#1359](https://github.com/mobxjs/mobx/pull/1359)
Expand Down
2 changes: 1 addition & 1 deletion src/api/autorun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export function reaction<T>(
setTimeout(() => {
isScheduled = false
reactionRunner()
}, opts.delay)
}, opts.delay!)
}
})

Expand Down
2 changes: 1 addition & 1 deletion src/core/globalstate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ let warnedAboutMultipleInstances = false
"[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details."
)
}
})
}, 1)
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/utils/eq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { areBothNaN, isArrayLike, isES6Map, iteratorToArray } from "./utils"
import { observable } from "../api/observable"
import { isObservableArray, isObservableMap } from "../mobx"

// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
declare var Symbol
const toString = Object.prototype.toString

export function deepEqual(a, b): boolean {
return eq(a, b)
}

// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
// Internal recursive comparison function for `isEqual`.
function eq(a, b, aStack?, bStack?) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
Expand All @@ -23,8 +25,6 @@ function eq(a, b, aStack?, bStack?) {
return deepEq(a, b, aStack, bStack)
}

const toString = Object.prototype.toString

// Internal recursive comparison function for `isEqual`.
function deepEq(a, b, aStack?, bStack?) {
// Unwrap any wrapped objects.
Expand Down
6 changes: 3 additions & 3 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export const EMPTY_ARRAY = []
Object.freeze(EMPTY_ARRAY)

declare var global
declare var window, global, Symbol

export function getGlobal() {
return typeof window !== "undefined" ? window : global
}
Expand Down Expand Up @@ -182,8 +183,6 @@ export function iteratorToArray<T>(it: Iterator<T>): ReadonlyArray<T> {
return res
}

declare var Symbol

export function primitiveSymbol() {
return (typeof Symbol === "function" && Symbol.toPrimitive) || "@@toPrimitive"
}
Expand All @@ -196,3 +195,4 @@ import { globalState } from "../core/globalstate"
import { IObservableArray, isObservableArray } from "../types/observablearray"
import { isObservableMap, ObservableMap, IKeyValueMap } from "../types/observablemap"
import { observable } from "../api/observable"
import { Iterator } from "./iterable"
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"noImplicitAny": false,
"moduleResolution": "node",
"lib": [
"es5",
"dom"
"es5"
]
},
"include": [
Expand Down

0 comments on commit 3baf30c

Please sign in to comment.