Summary: | Implement ArrayBuffer.isView | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||||
Component: | JavaScriptCore | Assignee: | Brent Fulgham <bfulgham> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bfulgham, fpizlo, oliver, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Brent Fulgham
2013-12-19 11:49:11 PST
Created attachment 219690 [details]
Patch
Comment on attachment 219690 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=219690&action=review Almost there :) > Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp:56 > + putDirectNativeFunction(vm, globalObject(), makeIdentifier(vm, ("isView")), 1, arrayBufferFuncIsView, NoIntrinsic, DontEnum |Function); JSC_NATIVE_FUNCTION(vm.propertyNames->isView, arrayBufferFuncIsView, DontEnum, 1); Add isView to CommonIdentifiers Comment on attachment 219690 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=219690&action=review >> Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp:56 >> + putDirectNativeFunction(vm, globalObject(), makeIdentifier(vm, ("isView")), 1, arrayBufferFuncIsView, NoIntrinsic, DontEnum |Function); > > JSC_NATIVE_FUNCTION(vm.propertyNames->isView, arrayBufferFuncIsView, DontEnum, 1); > > Add isView to CommonIdentifiers I tried using JSC_NATIVE_FUNCTION, but it assumes "globalObject" is defined in the current scope (except as a function), so the macro gives a syntax error. Comment on attachment 219690 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=219690&action=review R=me unless Oliver has super strong opinions about that macro. >>> Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp:56 >>> + putDirectNativeFunction(vm, globalObject(), makeIdentifier(vm, ("isView")), 1, arrayBufferFuncIsView, NoIntrinsic, DontEnum |Function); >> >> JSC_NATIVE_FUNCTION(vm.propertyNames->isView, arrayBufferFuncIsView, DontEnum, 1); >> >> Add isView to CommonIdentifiers > > I tried using JSC_NATIVE_FUNCTION, but it assumes "globalObject" is defined in the current scope (except as a function), so the macro gives a syntax error. Yeah, other places that use JSC_NATIVE_FUNCTION often have some pro-forma setup like: JSGlobalObject* globalObject = prototype->globalObjects(); Or whatever is appropriate. I don't mind that you're calling putDirectNativeFunction directly. But, you should add isView to CommonIdentifiers. Then you'll access it by saying vm.propertyNames->isView. This isn't a big deal, but it's nice to be consistent. Created attachment 219699 [details]
Patch
Committed r160876: <http://trac.webkit.org/changeset/160876> |