摘自web IDL规范3.2.4.2节 stringfiers
In the ECMAScript binding, using a Student object in a context where a string is expected will result in the value of the object’s “name” property being used:
ECMAScript
var s = new Student();
s.id = 12345678;
s.name = '周杰倫';
var greeting = 'Hello, ' + s + '!'; // Now greeting == 'Hello, 周杰倫!'.
本文介绍了WebIDL规范中关于字符串化的实现机制,特别是在ECMAScript绑定环境下如何使用Student对象的名称属性作为字符串化后的结果。
3190

被折叠的 条评论
为什么被折叠?



