Merge pull request #1813 from 1ec5/patch-1
Fixed passing non-Ranges into Document methods
This commit is contained in:
commit
7981e0ca6c
1 changed files with 2 additions and 2 deletions
|
|
@ -402,7 +402,7 @@ var Document = function(text) {
|
|||
*
|
||||
**/
|
||||
this.remove = function(range) {
|
||||
if (!range instanceof Range)
|
||||
if (!(range instanceof Range))
|
||||
range = Range.fromPoints(range.start, range.end);
|
||||
// clip to document
|
||||
range.start = this.$clipPosition(range.start);
|
||||
|
|
@ -522,7 +522,7 @@ var Document = function(text) {
|
|||
*
|
||||
**/
|
||||
this.replace = function(range, text) {
|
||||
if (!range instanceof Range)
|
||||
if (!(range instanceof Range))
|
||||
range = Range.fromPoints(range.start, range.end);
|
||||
if (text.length == 0 && range.isEmpty())
|
||||
return range.start;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue