@canvasengine/compiler 2.0.0-beta.7 → 2.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/grammar.pegjs CHANGED
@@ -138,7 +138,7 @@ eventAttribute
138
138
  staticValue
139
139
  = [^"]+ {
140
140
  var val = text();
141
- return isNaN(val) ? `'${val}'` : val;
141
+ return `'${val}'`
142
142
  }
143
143
 
144
144
  content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canvasengine/compiler",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-beta.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -123,18 +123,18 @@ describe("Compiler", () => {
123
123
  expect(output).toBe(`h(Canvas, { width: computed(() => x() * 2 * y()) })`);
124
124
  });
125
125
 
126
- test("should compile component with static numeric attribute", () => {
127
- const input = `<Canvas width="10" />`;
128
- const output = parser.parse(input);
129
- expect(output).toBe(`h(Canvas, { width: 10 })`);
130
- });
131
-
132
126
  test("should compile component with static string attribute", () => {
133
127
  const input = `<Canvas width="val" />`;
134
128
  const output = parser.parse(input);
135
129
  expect(output).toBe(`h(Canvas, { width: 'val' })`);
136
130
  });
137
131
 
132
+ test("should compile component with static attribute (with number)", () => {
133
+ const input = `<Canvas width="10" />`;
134
+ const output = parser.parse(input);
135
+ expect(output).toBe(`h(Canvas, { width: '10' })`);
136
+ });
137
+
138
138
  test("should compile component with children", () => {
139
139
  const input = `
140
140
  <Canvas>