-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle inline define-map static properties transformation (#157)
* handle inline define-map static properties transformation * Remove unused code * Add only seal to static properties when it is true * Seal observable objects * Cleaning * Just remove static properties
- Loading branch information
1 parent
893dd9d
commit 9ae13c2
Showing
7 changed files
with
110 additions
and
12 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
11 changes: 11 additions & 0 deletions
11
src/templates/can-observable-object/observable-object-static-properties-input.js
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,11 @@ | ||
const Todo = DefineMap.extend('Foo', { bar: 'Bar', seal: true}, { | ||
foo: "number" | ||
}); | ||
|
||
const MyTodo = DefineMap.extend({ bar: 'Bar', seal: false}, { | ||
foo: "number" | ||
}); | ||
|
||
const MyOtherTodo = DefineMap.extend('Foo', { | ||
foo: "number" | ||
}); |
23 changes: 23 additions & 0 deletions
23
src/templates/can-observable-object/observable-object-static-properties-output.js
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,23 @@ | ||
class Todo extends ObservableObject { | ||
static get props() { | ||
return { | ||
foo: "number" | ||
}; | ||
} | ||
} | ||
|
||
class MyTodo extends ObservableObject { | ||
static get props() { | ||
return { | ||
foo: "number" | ||
}; | ||
} | ||
} | ||
|
||
class MyOtherTodo extends ObservableObject { | ||
static get props() { | ||
return { | ||
foo: "number" | ||
}; | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
test/fixtures/version-6/can-observable-object/observable-object-static-properties-input.js
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,11 @@ | ||
const Todo = DefineMap.extend('Foo', { bar: 'Bar', seal: true}, { | ||
foo: "number" | ||
}); | ||
|
||
const MyTodo = DefineMap.extend({ bar: 'Bar', seal: false}, { | ||
foo: "number" | ||
}); | ||
|
||
const MyOtherTodo = DefineMap.extend('Foo', { | ||
foo: "number" | ||
}); |
23 changes: 23 additions & 0 deletions
23
test/fixtures/version-6/can-observable-object/observable-object-static-properties-output.js
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,23 @@ | ||
class Todo extends ObservableObject { | ||
static get props() { | ||
return { | ||
foo: "number" | ||
}; | ||
} | ||
} | ||
|
||
class MyTodo extends ObservableObject { | ||
static get props() { | ||
return { | ||
foo: "number" | ||
}; | ||
} | ||
} | ||
|
||
class MyOtherTodo extends ObservableObject { | ||
static get props() { | ||
return { | ||
foo: "number" | ||
}; | ||
} | ||
} |