Include the notifySplices method, and also add a trivial test for the

ArraySplice function with mutable and immutable arrays.
This commit is contained in:
Ruben
2018-03-28 15:51:09 +02:00
parent 73f9ae0086
commit c8b901e452
2 changed files with 10 additions and 0 deletions

View File

@@ -139,6 +139,8 @@ declare global {
unshift?(path: string, ...item: any[]): number;
notifySplices?(path: string, splices: ReadonlyArray<polymer.PolymerSplice>): void;
// ResolveUrl
resolveUrl?(url: string): string;

View File

@@ -82,3 +82,11 @@ class MyElement3 implements polymer.Base {
}
Polymer(MyElement3);
// Test splice computation
const splices: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices(
[1,2,3], [1,2]);
// Test that readonly arrays also work.
const splices2: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices(
Object.freeze([1,2,3]), Object.freeze([1,2]));