From 9a3e3515a503946a07fdc4e7fa2acec309012523 Mon Sep 17 00:00:00 2001 From: dhrname Date: Sat, 16 May 2015 22:47:15 +0900 Subject: [PATCH] Modify the push method of the object --- org/w3c/dom/smil.js | 6 ++++-- tool/Spec/spec/SvgDomSpec.js | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index c6edb23..2dc7ec9 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -162,6 +162,7 @@ base("$frame").mix ( { timelines[i].setFrame(num); } }, + /*addLineメソッド * タイムラインを追加したあと、trueを返す * ただし、引数objのobj.beginとobj.activeTimeが定まっていない場合はfalseを返す*/ @@ -727,9 +728,10 @@ base("$calcMode").up("$attribute").mix( { frame.listener( { timeStamp: Date.now() } ); - $frame.addLine(frame); this.frame.push(frame); - } + } + /*setFrameメソッドを使ったときの、再帰スタックの使いすぎを防ぐため*/ + frame.timelines = []; getAttr = begin = ele = void 0; return frame; diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index cc5fd22..570bca5 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -2115,6 +2115,11 @@ describe("SMIL Animation Spec", function() { expect(frame.timelines[0]).toBe(timeline); frame.removeLine(timeline); expect(frame.timelines[0]).not.toBe(timeline); + + frame.addLine(frame.up().mix( { + timelines: [] + } )); + expect(frame.timelines).not.toBe(frame.$1.timelines); }); /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/ it("should be this for the value (the invalid partion)", function() { -- 2.11.0