WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
jsc-jsdictionary-array.patch (text/plain), 3.39 KB, created by
Michael Pruett
on 2012-12-05 12:05:50 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Pruett
Created:
2012-12-05 12:05:50 PST
Size:
3.39 KB
patch
obsolete
>From: Michael Pruett <michael@68k.org> >Date: Wed, 5 Dec 2012 11:51:52 -0800 >Subject: [JSC] Check whether property is an array before attempting conversion to array in JSDictionary > >--- > Source/WebCore/ChangeLog | 22 ++++++++++++++++++++++ > Source/WebCore/bindings/js/JSDictionary.cpp | 17 +++++++++++++++++ > Source/WebCore/bindings/js/JSDictionary.h | 3 +++ > 3 files changed, 42 insertions(+) > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 77cba8f..2d8f5a3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2012-12-05 Michael Pruett <michael@68k.org> >+ >+ [JSC] Check whether property is an array before attempting conversion to array in JSDictionary >+ https://bugs.webkit.org/show_bug.cgi?id=96614 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ JSDictionary should check whether the property being accessed in get() >+ is an array before attempting to convert the value to an array. >+ >+ Previously calling get() with a result type of Vector<String> when >+ the named property could not be converted to an array would generate >+ an exception. >+ >+ Tests: storage/indexeddb/* >+ >+ * bindings/js/JSDictionary.cpp: >+ (WebCore): >+ (WebCore::JSDictionary::get): >+ * bindings/js/JSDictionary.h: >+ (WebCore): >+ > 2012-12-05 Robert Hogan <robert@webkit.org> > > REGRESSION(r126683): Table cell are getting borders when the style doesn't mention any >diff --git a/Source/WebCore/bindings/js/JSDictionary.cpp b/Source/WebCore/bindings/js/JSDictionary.cpp >index 4e2dd4c..9746d1c 100644 >--- a/Source/WebCore/bindings/js/JSDictionary.cpp >+++ b/Source/WebCore/bindings/js/JSDictionary.cpp >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2011 Apple Inc. All rights reserved. >+ * Copyright (C) 2012 Michael Pruett <michael@68k.org> > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -228,4 +229,20 @@ bool JSDictionary::getWithUndefinedOrNullCheck(const String& propertyName, Strin > return true; > } > >+template <> >+bool JSDictionary::get(const char* propertyName, Vector<String>& result) const >+{ >+ JSValue value; >+ GetPropertyResult getPropertyResult = tryGetProperty(propertyName, value); >+ if (getPropertyResult != PropertyFound) >+ return false; >+ if (!value.isObject()) >+ return false; >+ JSObject* object = asObject(value); >+ if (!isJSArray(object) && !object->inherits(&JSArray::s_info)) >+ return false; >+ convertValue(m_exec, value, result); >+ return m_exec->hadException(); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/bindings/js/JSDictionary.h b/Source/WebCore/bindings/js/JSDictionary.h >index e17f868..29d644c 100644 >--- a/Source/WebCore/bindings/js/JSDictionary.h >+++ b/Source/WebCore/bindings/js/JSDictionary.h >@@ -139,6 +139,9 @@ bool JSDictionary::get(const char* propertyName, Result& finalResult) const > return tryGetPropertyAndResult(propertyName, &finalResult, IdentitySetter<Result>::identitySetter) == PropertyFound; > } > >+template <> >+bool JSDictionary::get(const char* propertyName, Vector<String>& result) const; >+ > template <typename T, typename Result> > JSDictionary::GetPropertyResult JSDictionary::tryGetPropertyAndResult(const char* propertyName, T* context, void (*setter)(T* context, const Result&)) const > { >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
haraken
:
review-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 96614
:
163809
|
164065
|
173253
|
173261
|
173304
|
173306
|
173540
|
177806
|
177865
|
177906
|
177907
|
178728
|
179040
|
179158
|
179326
|
179456