W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2013

Checking for (JSON) serialisable object

From: Marcos Caceres <marcosscaceres@gmail.com>
Date: Mon, 11 Feb 2013 22:20:10 +0000
To: public-script-coord@w3.org
Message-ID: <3A7D8F3F91684234A6BDB9DE5F106B56@gmail.com>
In the Web Alarm spec, there is a method "add()" on an AlarmManager Interface [1] that takes an "optional Object data" :  

  AlarmRequest add(Date date, TimezoneDirective respectTimezone, optional Object data);

The problem is the "data" argument is restricted, in prose, to only allow JSON-serializable objects - leading to a mismatch between the WebIDL and the prose. So, question is, what is the right way to specify that? Is there some WebIDL magic or does it just need to be defined in prose? Like:

1. let result be the result of calling JSON.stringify on the third argument. If there is an error throw…     

Any guidance would be appreciated.  

[1] http://www.w3.org/TR/2013/WD-web-alarms-20130205/#alarmmanager--  
Marcos Caceres
http://datadriven.com.au
Received on Monday, 11 February 2013 22:20:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:09 UTC