mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Add Range.fromObject, which takes a [start, end] array
This commit is contained in:
@@ -4,6 +4,13 @@ _ = require 'underscore'
|
||||
|
||||
module.exports =
|
||||
class Range
|
||||
@fromObject: (object) ->
|
||||
if _.isArray(object)
|
||||
new Range(object...)
|
||||
else
|
||||
object
|
||||
|
||||
|
||||
constructor: (pointA = new Point(0, 0), pointB = new Point(0, 0)) ->
|
||||
pointA = Point.fromObject(pointA)
|
||||
pointB = Point.fromObject(pointB)
|
||||
|
||||
Reference in New Issue
Block a user