From 0a6de8edb8b51906f4bb5f8e585789acc4e84433 Mon Sep 17 00:00:00 2001 From: eight Date: Mon, 16 Oct 2017 16:05:41 +0800 Subject: [PATCH] Add: make dirtyReporter.clear accept a key --- edit/util.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/edit/util.js b/edit/util.js index 43325c27..84b2e7d2 100644 --- a/edit/util.js +++ b/edit/util.js @@ -46,8 +46,12 @@ function dirtyReporter() { } } - function clear() { - dirty.clear(); + function clear(obj) { + if (obj === undefined) { + dirty.clear(); + } else { + dirty.delete(obj); + } } function isDirty() {