From 18dd0af6c1de51ea668c073076a1fb2b4dc5a83d Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 26 Mar 2015 15:03:44 +0000 Subject: [PATCH] Removed assertions about invalid characters in Identifier constructors. --- modules/juce_core/text/juce_Identifier.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/juce_core/text/juce_Identifier.cpp b/modules/juce_core/text/juce_Identifier.cpp index bac4dd58a9..4d9d3ea55f 100644 --- a/modules/juce_core/text/juce_Identifier.cpp +++ b/modules/juce_core/text/juce_Identifier.cpp @@ -40,25 +40,22 @@ Identifier& Identifier::operator= (const Identifier other) noexcept Identifier::Identifier (const String& nm) : name (StringPool::getGlobalPool().getPooledString (nm)) { - /* An Identifier string must be suitable for use as a script variable or XML - attribute, so it can only contain this limited set of characters.. */ - jassert (isValidIdentifier (toString())); + // An Identifier cannot be created from an empty string! + jassert (nm.isNotEmpty()); } Identifier::Identifier (const char* nm) : name (StringPool::getGlobalPool().getPooledString (nm)) { - /* An Identifier string must be suitable for use as a script variable or XML - attribute, so it can only contain this limited set of characters.. */ - jassert (isValidIdentifier (toString())); + // An Identifier cannot be created from an empty string! + jassert (nm != nullptr && nm[0] != 0); } Identifier::Identifier (String::CharPointerType start, String::CharPointerType end) : name (StringPool::getGlobalPool().getPooledString (start, end)) { - /* An Identifier string must be suitable for use as a script variable or XML - attribute, so it can only contain this limited set of characters.. */ - jassert (isValidIdentifier (toString())); + // An Identifier cannot be created from an empty string! + jassert (start < end); } Identifier Identifier::null;