forked from emberjs/data
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixup transpilation issues with @ember/ordered-set. (emberjs#5557)
* Ensure tests run minimally transpiled. * Add specific test run for full transpilation. * [BUGFIX beta] Prevent transpilation issues with @ember/ordered-set. * Fix ES compatibility issues. These cases were all previously working due to transpilation from `let` to `var`. You *cannot* reference a block scoped variable (`let` / `const`) during the variables own initializer.
- Loading branch information
1 parent
d1e5a71
commit 0e99af0
Showing
8 changed files
with
55 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,30 @@ | ||
import EmberOrderedSet from '@ember/ordered-set'; | ||
import { guidFor } from '@ember/object/internals'; | ||
|
||
export default function OrderedSet() { | ||
this._super$constructor(); | ||
} | ||
export default class EmberDataOrderedSet extends EmberOrderedSet { | ||
static create() { | ||
return new this(); | ||
} | ||
|
||
OrderedSet.create = function() { | ||
let Constructor = this; | ||
return new Constructor(); | ||
}; | ||
addWithIndex(obj, idx) { | ||
let guid = guidFor(obj); | ||
let presenceSet = this.presenceSet; | ||
let list = this.list; | ||
|
||
OrderedSet.prototype = Object.create(EmberOrderedSet.prototype); | ||
OrderedSet.prototype.constructor = OrderedSet; | ||
OrderedSet.prototype._super$constructor = EmberOrderedSet; | ||
if (presenceSet[guid] === true) { | ||
return; | ||
} | ||
|
||
OrderedSet.prototype.addWithIndex = function(obj, idx) { | ||
let guid = guidFor(obj); | ||
let presenceSet = this.presenceSet; | ||
let list = this.list; | ||
presenceSet[guid] = true; | ||
|
||
if (presenceSet[guid] === true) { | ||
return; | ||
} | ||
if (idx === undefined || idx === null) { | ||
list.push(obj); | ||
} else { | ||
list.splice(idx, 0, obj); | ||
} | ||
|
||
presenceSet[guid] = true; | ||
this.size += 1; | ||
|
||
if (idx === undefined || idx === null) { | ||
list.push(obj); | ||
} else { | ||
list.splice(idx, 0, obj); | ||
return this; | ||
} | ||
|
||
this.size += 1; | ||
|
||
return this; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; | ||
|
||
const needsIE11 = !!process.env.TARGET_IE11; | ||
|
||
if (needsIE11) { | ||
browsers.push('ie 11'); | ||
} | ||
|
||
module.exports = { | ||
browsers, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters