Comments (6)
Oh, this went away with platform array objects, looks like. That's bad.
from webidl.
In particular, in #52
from webidl.
Oh, but more to the point, we don't need this thing because in ES6 the contract for [[DefineOwnProperty]]
doesn't involve throwing at all. You just return false and the caller throws if needed.
@heycam should we just update all out [[DefineOwnProperty]] to the ES6 definition?
from webidl.
Yes I think we should update. And to me it looks like all [[DefineOwnProperty]] calls in Web IDL currently can just ignore its return value. Do you agree? Apart from http://heycam.github.io/webidl/#defineownproperty which needs to just return it.
from webidl.
@heycam The calls in dictionary and sequence idl-to-es conversion should never return false. Same thing in the unscopeables setup and serializer bits, So ignoring the return value there makes sense.
The call for [Replaceable] attribute setters, however, I think should probably throw if false is returned. Testing this in browsers is a bit of a pain because you can't freeze a Window effectively, but this is a testcase:
var str = "Object.freeze(self); self.console = 5; postMessage(typeof console);"
var blob = new Blob([str]);
var url = URL.createObjectURL(blob);
var w = new Worker(url);
w.onmessage = function (e) {
alert("OK: " + e.data);
}
w.onerror = function (e) {
alert("Error: " + e.message);
}
Looks to me like this throws in Firefox but not Chrome (which silently ignores the set instead)... Chrome doesn't throw with use strict
there either, of course. In any case, I think we basically want the behavior here to be like Object.defineProperty, which would throw in this situation, so throwing makes sense to me.
from webidl.
Note that the this was fixed by 8c9b828
from webidl.
Related Issues (20)
- “Define the (static|unforgeable regular) attributes” algs say namespace is a possible argument
- ByteString text should not talk about UTF-8 HOT 1
- Improperly pluralized verb in "The [LegacyNamespace] extended attribute take an identifier"
- Detect whether a dictionary member was set by default or not HOT 2
- Throwing DOMExceptions in the context of a promise returning operation HOT 2
- Float16Array integration
- Buffer source types infrastructure HOT 3
- Editorial: pick JavaScript or ECMAScript and stick with it HOT 1
- Simple exceptions “apart from...” list is incomplete HOT 1
- Give SharedArrayBuffer a dedicated type (downstream) HOT 2
- Defining AbstractModuleSource intrinsic inheritance HOT 13
- Language-independent definition of interfaces should mention how to create instances HOT 5
- Meta: npm warnings HOT 1
- Definition name uniqueness requirement omits mixins
- Suggestion: forbid ECMA-262/402-defined global names for some named constructs HOT 2
- Nullable ObservableArray attributes are not supported HOT 1
- Make ObservableArray "subclassable" HOT 3
- Definition of {} is slightly ambiguous HOT 2
- Named properties object [[GetOwnProperty]] conflicts with class string HOT 1
- Add `toggle()` and `replace()` methods to `setlike` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webidl.